📄 customer.java
字号:
package People;
import Accounts.Account;
import dslib.list.LinkedListUos;
/** A bank customer with a list of accounts. */
public class Customer extends Person
{
/** A linked list of accounts that belong to this Customer */
private LinkedListUos accounts;
/** Construct a new Customer from a name */
public Customer(String n)
{
super(n);
accounts = new LinkedListUos();
}
/** Add the specified Account to the linked list of accounts */
public void addAccount(Account a)
{
accounts.insert(a);
}
/** Return a string representation of the Customer */
public String toString()
{
String temp = "Name: " + name + "\n";
accounts.goFirst();
while (!accounts.after())
temp += accounts.item().toString();
return temp;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -