Specialisation
Submitted by BinksUK on
Specialisation allows new classes, called subclasses, to be constructed from existing classes, the superclasses.
The subclass inherits all of the instance variables and instance methods of the its superclass. It can then use these and add further methods and variables as well as overriding the existing methods to create a more specialised class.
Specialisation aids code re-use, the new classes don't have to rewrite existing methods if they meet their purpose.
Constructors are not members so are not inherited by subclasses.
Private members can not be accessed by subclasses - they are still inherited howevre and can be accessed by inner classes.
Add new comment