Java Reference
In-Depth Information
PasswordException
usage()
PasswordExpired
Exception
PasswordInvalid
Exception
PasswordInternal
Exception
getCount()
resetCount()
PasswordInvalidFormat
Exception
PasswordUsed
Exception
PasswordSize
Exception
getPswdSize()
getMinSize()
getMaxSize()
FIGURE 10-3
Examining an Inheritance Hierarchy
In this case, the PasswordException class is at the top, or root , of this
inheritance hierarchy, making it the base class for this inheritance hierarchy.
Being a base class means that all classes listed below it are subclasses of the
PasswordException class and may inherit from the PasswordException class.
As you learned in Chapter 1, the class providing the inherited features is the
superclass, or parent class , and the class inheriting attributes and behaviors is
called the subclass, or child class .
A subclass always is below a superclass in an inheritance hierarchy;
however, inheritance is not limited to only one level of parent and child
classes, or superclass and subclasses. Just as a human parent is a child of his
or her own parent, so a parent class can be a child of another class, thereby
inheriting features from its parent class. Therefore, as illustrated by the
inheritance hierarchy in Figure 10-3, the PasswordSizeException class not
only inherits from the PasswordInvalidFormatException class, but also
from the PasswordInvalidException class and the PasswordException class.
PasswordSizeException, therefore, is said to be a type of PasswordException, and
in this case, a type of the other exception classes between them in the hierarchy
(PasswordInvalidException and PasswordInvalidFormatException).
 
Search WWH ::




Custom Search