📄 item.java
字号:
package developerworks.ajax.store;import java.math.BigDecimal;public class Item { private String code; private String name; private String description; private int price; public Item(String code,String name,String description,int price) { this.code=code; this.name=name; this.description=description; this.price=price; } public String getCode() { return code; } public String getName() { return name; } public String getDescription() { return description; } public int getPrice() { return price; } public String getFormattedPrice() { return "$"+new BigDecimal(price).movePointLeft(2); } public boolean equals(Object o) { if (this == o) return true; if (this == null) return false; if (!(o instanceof Item)) return false; return ((Item)o).getCode().equals(this.code); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -