📄 cartitem.java
字号:
package RegisterAndLogin;
//购物车中的一个条目
import java.io.Serializable;
class CartItem implements Serializable
{
merchandise goods=null;
int quantity=0;
public CartItem(merchandise goods)
{
this.goods=goods;
this.quantity=1;
}
public void setgoods(merchandise goods)
{
this.goods=goods;
}
public merchandise getgoods()
{
return goods;
}
public int getQuantity()
{
return quantity;
}
public void setQuantity(int quantity)
{
this.quantity=quantity;
}
public float getItemPrice()
{
float price=goods.getPrice()*quantity;
long val=Math.round(price*100);
return val/100.0f;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -