October 2011
Beginner
432 pages
10h 18m
English
Inheritance, which enables a variety of related classes to be developed without redundant work, makes it possible for code to be passed down from one class to another class to another class. This grouping of classes is called a class hierarchy, and all the standard classes you can use in your Java programs are part of a hierarchy.
Understanding a hierarchy is easier if you understand subclasses and superclasses. A class that inherits from another class is called a subclass. The class that is inherited from is called a superclass.
In the preceding WarGames example, the Modem class is the superclass of the ErrorCorrectionModem class. ErrorCorrectionModem is the subclass of Modem.
A class can have more than one ...
Read now
Unlock full access