September 2005
Beginner
576 pages
13h 6m
English
Inheritance, which enables a variety of related classes to be developed without a lot of redundant work, makes it possible for code to be passed down from one class to another class to another class. This organization of classes is called a class hierarchy, and all of the standard classes you can use in your Java programs are part of a hierarchy.
Understanding a hierarchy is easier if you understand what subclasses and superclasses are. A class that inherits from another class is called a subclass, and the class that is inherited from is called a superclass.
In the preceding War Games example, the Modem class is the superclass of the ErrorCorrectionModem class. ErrorCorrectionModem is the subclass of Modem. A ...
Read now
Unlock full access