Java Reference
In-Depth Information
Homework Assignments
Identify Code
Identify the code elements shown in Figure 9-44.
final static int
MIN_SIZE = 6;
final static int
MAX_SIZE = 15;
static int
maxHistory = 4;
static int
expiresNotifyLimit = 3;
private int
maxUses = 120;
private int
remainingUses = maxUses;
private boolean
autoExpires =
true
;
private boolean
expired =
false
;
private
ArrayList pswdHistory;
2
1
3
// Constructors for objects of class Password
public
Password
(
String
newPassword
)
throws
Exception
{
pswdHistory =
new
ArrayList
(
maxHistory
)
;
set
(
newPassword
)
;
}
public
Password
(
String
newPassword,
int
numMaxUses
)
throws
Exception
{
pswdHistory =
new
ArrayList
(
maxHistory
)
;
maxUses = numMaxUses;
remainingUses = numMaxUses;
set
(
newPassword
)
;
}
public
Password
(
String
newPassword,
boolean
pswdAutoExpires
)
throws
Exception
{
4
pswdHistory =
new
ArrayList
(
maxHistory
)
;
autoExpires = pswdAutoExpires;
set
(
newPassword
)
;
}
public
Password
(
String
newPassword,
int
numMaxUses,
boolean
pswdAutoExpires
)
throws
Exception
{
pswdHistory =
new
ArrayList
(
maxHistory
)
;
maxUses = numMaxUses;
remainingUses = numMaxUses;
autoExpires = pswdAutoExpires;
set
(
newPassword
)
;
}
public boolean
getAutoExpires
()
{
5
return
autoExpires;
}
FIGURE 9-44
1.
__________________
2.
__________________
3.
__________________
4.
__________________
5.
__________________
Search WWH ::
Custom Search