
6.6 Inheritance: Packages: Interfaces
If a method violates the substitution principle and if it uses a reference to base class, when-
ever a new derived class is added, the function needs to be rewritten to include the new
derived class’s behaviour.
6.3 Member Access Rules
Access specifiers play an important role in inheritance relationships. We have learnt that if we
foresee inheritance and we need to allow subclass to access the super’s members, we need to
declare them as protected.
If we declare the members as private, then they are visible inside a class only. They are not
visible to subclasses or outside the class.
Default access specifiers ...