Java Reference
In-Depth Information
9 @param aPin
the personal identification number
10 */
11
public
Customer(
int
aNumber,
int
aPin)
12 {
13 customerNumber = aNumber;
14 pin = aPin;
15 checkingAccount =
new
BankAccount();
16 savingsAccount =
new
BankAccount();
17 }
18
19 /**
20
Tests if this customer matches a customer number
21
and PIN.
22 @param aNumber
a customer number
23 @param aPin
a personal identification number
24 @return true
if the customer number and PIN match
25 */
26
public boolean
match(
int
aNumber,
int
aPin)
27 {
28
return
customerNumber == aNumber && pin
== aPin;
29 }
30
31 /**
32
Gets the checking account of this customer.
33 @return
the checking account
34 */
35
public
BankAccount getCheckingAccount()
36 {
37
return
checkingAccount;
38 }
39
40 /**
41
Gets the savings account of this customer.
42 @return
the checking account
43 */
44
public
BankAccount getSavingsAccount()
45 {
46
return
savingsAccount;
47 }
48
568
569