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
Define constructors
What is xml comments in c#?
What is a generic in c#?
Can namespace contain the private class?
What are the types of attributes in c#?
What is int32?
What is difference between asp net and c# net?
What is the difference between a field and a property in c#?
What is dictionary and hashtable in c#?
What is a destructor in c#?
What is default access specifier for class in c#?
How to assign Null value to Var?
What is the property of class?
What is scope c#?
What is expression tree with example?