為什么老是提示Syntax error, insert "}" to complete ClassBody
package entity;
import java.util.HashMap;
//購(gòu)物車
public class Cart {
//購(gòu)買商品的集合
private HashMap<Items,Integer> goods;
//購(gòu)物車的總金額
private double totalPrice;
//構(gòu)造方法
?//c初始化屬性
public Cart()
{
goods = new HashMap<Items,Integer>();
totalPrice = 0.0;
}
public HashMap<Items, Integer> getGoods()?
{
return goods;
}
public void setGoods(HashMap<Items, Integer> goods)
{
this.goods = goods;
}
public double getTotalPrice()?
{
return totalPrice;
}
public void setTotalPrice(double totalPrice)?
{
this.totalPrice = totalPrice;
} ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?這里有提示
//添加商品進(jìn)購(gòu)物車的方法?
public boolean addGoodsInCart(Items item ,int number) ? ? ? ? ? ? ? ? ? ? ?這里也有
?}
2015-05-03
你不覺得你少了2個(gè)大括號(hào)嗎?