In inheritance does the private members of superclass are inherited to subclass?

Questions by vijay_jadhao

Showing Answers 1 - 5 of 5 Answers

RATNAMBABU

  • Dec 8th, 2005
 

private members of a super class can be accessed if it is serialisable,but cannot be modified by subclass.

  Was this answer useful?  Yes

manjunath shenoy

  • Jan 18th, 2006
 

NO,not at all.Infact the access specifier PRIVATEensures that data members of that class is not inherited.This helps in the concept so called data hiding or encapsulation.If u want that ur code can b inherited then use PUBLIC,or PROTECTED.These allow inheritance.

  Was this answer useful?  Yes

Shweta

  • Oct 27th, 2006
 

No, In Inheritance only the public and protected memberes of the base class can b inherited by the derived class. Private members r only accessible to the member functions of the class.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions