savingsaccount.java
来自「国外的数据结构与算法分析用书」· Java 代码 · 共 25 行
JAVA
25 行
package Accounts;
import People.Customer;
import dslib.base.FormatUos;
/** A savings account. */
public class SavingsAccount extends RegularAccount
{
/** Construct a SavingsAccount from a customer
and an account number */
public SavingsAccount(Customer c, int n)
{
super(c, n);
}
/** Return a string representation of the SavingsAccount */
public String toString()
{
return "Savings account " + number + ": Owner " + owner.name()
+ "\n" + FormatUos.pad("", 11, 'l') + "Balance "
+ FormatUos.withDecimals(balance, 2) + "\n";
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?