📄 customer.java
字号:
package banking;
public class Customer {
// Data Attributes
private String firstName;
private String lastName;
// Association Attributes
//Please define private array about account;
private Account account[];
private int numberOfAccounts = 0;
public Customer(String f, String l) {
firstName = f;
lastName = l;
account=new Account[2];
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public void addAccount(Account acct) {
if(numberOfAccounts<10)
account[numberOfAccounts++]=acct;
}
public Account getAccount(int account_index) {
return account[account_index];
}
public int getNumOfAccounts() {
return numberOfAccounts;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -