Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Can we inherit a private class in chsarp? how? explain(with
code) ?

Answers were Sorted based on User's Feedback



Can we inherit a private class in chsarp? how? explain(with code) ? ..

Answer / tiger skumar

Private class cannot inherit be inherited in the derived class.

Is This Answer Correct ?    17 Yes 1 No

Can we inherit a private class in chsarp? how? explain(with code) ? ..

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

Can we inherit a private class in chsarp? how? explain(with code) ? ..

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

Can we inherit a private class in chsarp? how? explain(with code) ? ..

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

Post New Answer

More C Sharp Interview Questions

Does c# support multiple class inheritance?

0 Answers  


Is string reference type / value type?

56 Answers   Accenture, Microsoft, Siemens,


What is difference between arraylist and list in c#?

0 Answers  


From which base class do all Web Forms inherit from?

0 Answers   Siebel,


what is the need of using interface in program ex:if we have a program like this interface1() { void method1(); void method(); } class a1 : interface1 { a1 b = new b(); b.method1(); b.method2(); } so without using interface also we can achieve this then wat is the need to use the interface? plz give me the answer

1 Answers  


What is dao in c#?

0 Answers  


What is asenumerable in c#?

0 Answers  


How do you ensure the assembly created in c# is interoperable with vb.net?

4 Answers   IBM,


Can multiple inheritance implemented in c# ?

0 Answers  


Can constructor have return type c#?

0 Answers  


What is scaffolding in c#?

0 Answers  


Can you allow class to be inherited, but prevent the method from being over-ridden?

1 Answers  


Categories