Java Reference
In-Depth Information
inherits from
PasswordInvalidException
overrides method
in parent class to
return different
message
String message returned by
PasswordInvalidFormatException
usage() method
FIGURE 10-17
2. Create and then save a new document in the Chapter10 folder, or a
location specified by your instructor, typing PasswordSizeException
as the file name and selecting Java (*.java) as the file type. Enter lines 1
through 41 as shown in Figure 10-16. In the comments, insert your own
name as programmer and enter the current date. Save and compile the
PasswordSizeException class.
TextPad displays code for the initial comments, instance variables, class
header, constructor, and the accessor methods (Figure 10-18). This class
extends the concrete class, PasswordInvalidFormatException. The keyword,
this, is used to distinguish between instance variables and constructor
parameters of the same name.
inherits from
PasswordInvalidFormatException
private instance
variables
keyword, this,
distinguishes
instance variables
from constructor
parameters
instance variables
initialized in
constructor
accessor methods
FIGURE 10-18
 
Search WWH ::




Custom Search