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 does int32 mean in c#?
What Is A Satellite Assembly?
How do you create user defined data types in c#?
What is difference between method and function in c#?
What is razor view in c#?
What is the difference between static class and singleton class in c#?
What are logical operators in c#?
What's different between c# and c/c++?
What is class method?
Which is better interface or abstract class in c#?
hi, is compulsory .net knowledge need for biztalk server training. if need, how far?.tell me some info abt real time instructors in hyd or other?
How would you describe encapsulation in c#?
Why do we use ienumerable in c#?
Howmany five tracing levels in System.Diagnostics.TraceSwitcher? Why they are using?
What are the 3 different types of arrays?