Can we inherit a private class in chsarp? how? explain(with
code) ?
Answers were Sorted based on User's Feedback
Private class cannot inherit be inherited in the derived class.
| Is This Answer Correct ? | 17 Yes | 1 No |
Answer / 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 |
Answer / hassan-ak
WHERE IS THE INHERITANCE IN THIS CODE, WE KNOW THAT INNER
CLASSES CAN BE DECLARED PRIVATE BUT THE QUESTION IS: CAN IT
BE INHERITED, SINCE A PRIVATE FEILD IS NOT ACCESSED BY SUB
CLASS SO HOW IF THE WHOLE CLASS IS PRIVATE?
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / amit singh
Private class inherit in the derived class. When we create
instance of that class. Call that instance in derive class.
| Is This Answer Correct ? | 2 Yes | 6 No |
What is a class level variable in c#?
What is static noise?
what will be the output of the given below coding. using System; public class Exercise { static void OddNumbers(int a) { if (a >= 1) { Console.Write("{0}, ", a); a -= 2; OddNumbers(a); } } public static int Main() { const int Number = 9; Console.WriteLine("Odd Numbers"); OddNumbers(Number); Console.WriteLine(); return 0; } }
what is IDisposal interface,IComparable,IEquatable,IFormatable
Is python easier than c#?
what is a static constructor?
Explain lock, monitors, and mutex object in threading.
How can you reference current thread of the method ?
STATIC METHOD CAN BE OVERLOADING AND OVERIDNG? IS POSSIBLE IN iN c# .NET AND WHAT IS THE REASON??
Hoe can i connect the table into the c# application?
Which of the following API is used to hide a window?
What is a static field?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)