Java Reference
In-Depth Information
Figure 5.7 depicts these relationships among the classes. The diagram is in the
Universal Modeling Language (UML) notation for static class definitions. Each box
represents a class. The top section of each box contains the class name. The next
section describes the public data member names and their types. The last box de-
scribes methods explicitly defined in each class. Finally, the arrows represent the
class hierarchy. In this case, PrintfileErrorMsg and PopupErrorMsg inherit from
ErrorMsg . ErrorMsg inherits from TextMessage .
FIGURE 5.7
UML static class notation for ErrorMsg , PrintfileErrorMsg , and PopupErrorMsg .
J AVA I NTERFACES
Although a Java class cannot extend more than one base class, it can still implement
multiple interfaces , or method signatures that have been defined in another class.
This is how Java provides some of the benefits of C++'s multiple inheritance , which
is the ability of a single class to extend multiple base classes.
Search WWH ::




Custom Search