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 are circular references? How garbage collection deals with circular references.
Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?
How do I create a dbml file?
Can delegates be used as callbacks?
What is private variable?
what is virtual method in c#?
Distinguish between continue and break statement?
What do you mean by a windows process in regards to memory allocation?
Explain the difference between and xml documentation tag?
What is dll hell, and how does .net solve it?
How can i Spawn a Thread
What is an inheritance in c#?
Explain the different types of delegates used in c#.
What is an iqueryable in c#?
Is array a collection c#?