⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customer.java

📁 国外的数据结构与算法分析用书
💻 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 + -