Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we inherit a private class in chsarp? how? explain(with
code) ?

Answer Posted / manish

PRIVATE CLASS CAN BE INHERITTED ... REMEMBER INNER CLASS
CONCEPTS ,,,

PLEASE SEE THE CODE BELOW

public class OuterKing
{
public int i;

/// <summary>
/// PRIVATE BASE CLASS
/// </summary>
private class InnerJack
{
public InnerJack()
{
MessageBox.Show ("Private
class InnerJack Base Constructor");
}
public static int j =5;
public static void display()
{
MessageBox.Show (j.ToString
());
}
}

/// <summary>
/// CHILD CLASS
/// </summary>
private class InnerJackSon : InnerJack
{
public InnerJackSon()
{
MessageBox.Show ("Private
class InnerJackSon Child Constructor");
}
}

public void DisplayPrivate()
{
InnerJack.display ();
InnerJackSon IJS = new InnerJackSon
();

}

}

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many constructors can a class have c#?

852


Why do we use abstraction in c#?

851


Do events have return type c#?

870


Can you create an instance of a static class?

952


What is boxing in c#?

914


What are primitive data types in c#?

890


How do you inherit a class into other class in c#?

866


What is generic delegate in c#?

874


What is data type in c# with example?

963


What are the applications of c#?

1561


Explain the role of Garbage collector and its generations?

879


When To use HashTable In C#

956


What is the difference between do and while loop?

841


Tell me the difference between call by value and call by reference.

923


Is c sharp open source?

817