Java Reference
In-Depth Information
The following steps enter the code for the public instance methods, set() and
validate(), for the Password class.
To Code public Instance Methods
1. Enter lines 134 through 162 as shown in Figure 9-31.
TextPad displays the code for the set() method in the coding window
(Figure 9-33).
throws exception
if password not
added to ArrayList
ArrayList
contains()
method called
ArrayList size() method called
set() method
to set new
password value
and maintain
history
ArrayList remove()
method called
ArrayList add()
method called
if password
expired, reset to
not expired
remaining uses for
password set if password
automatically expires
FIGURE 9-33
(continued)
 
Search WWH ::




Custom Search