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
What is lazy loading c#?
What is out int in c#?
Is string passed by reference in c#?
What does exclamation mark mean c#?
Which programming language is best for desktop applications?
How do you declare a variable in c#?
What is difference between ienumerable and ienumerator in c#?
Why do we use classes?
Is list ienumerable c#?
how to create crystal reports give one detail example(i want to view age category report) please give suitable example in my small knowledge
can you allow a class to be inherited, but prevent the method from being over-ridden?
Is null c# operator?
How can I create a process that is running a supplied native executable (e.g., Cmd.exe)?
How to transpose multi-dimensional array?
What is a Command Object in C#?