Answered Questions

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

    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.

    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.