-
Notifications
You must be signed in to change notification settings - Fork 0
/
Customer.java
36 lines (28 loc) · 896 Bytes
/
Customer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package lab3;
public class Customer {
private String theName;
private CurrentAccount theCurrentAccount = null;
public Customer(String arg) {
theName = arg.trim();
}
public String getName() {
return theName;
}
public boolean hasCurrentAccount() {
if ((theCurrentAccount == null)) return false;
else return true;
}
public void addCurrentAccount(CurrentAccount arg) {
theCurrentAccount = arg;
}
public CurrentAccount getCurrentAccount() {
return theCurrentAccount;
}
public String toString() {
String result = "\n******************************";
result = result + "\nCustomer : " + theName;
if (hasCurrentAccount()) {result = result + "\nAccount number : " + String.valueOf(theCurrentAccount.getAccountNumber());}
result = result + "\n******************************";
return result;
}
} //måsvinge till Customer