📄 invoiceitem.java
字号:
package chapter1;
public class InvoiceItem extends Item {
//定义提货清单中每个条目的价格
protected double total;
//提货条目的构造函数,以相关的存货条目和提货数量为参数
public InvoiceItem(InventoryItem item, int _units) {
super(item.ID);
desc = item.desc;
price = item.price;
units = _units;
total = price * units;
}
//以字符串的形式返回提货清单中的一条提货条目
public String toString() {
return super.toString() + " = " + Util.dollar(total) + "\t(" + desc
+ ")";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -