⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 40c4b67598f4001b1767ee232a2585d9

📁 Internet 开发技术分章节代码和自己完成的课程设计全代码(在zuoye文件夹里)使用时
💻
字号:
package bean;
import java.util.HashMap;
public class Car {
	private String userId;//用户的标识
	private HashMap items;//购物车中的物品
	public Car(){items=new HashMap();	}
	public void addItem(String id,int quantity)
	{  items.put(id,new Integer(quantity)); 	}
	public void removeItem(String id)
	{ items.remove(id);	}
	public void updateItem(String id,int quantity)
	{
		if(items.containsKey(id))items.remove(id);
		items.put(id,new Integer(quantity));
	}
	public HashMap getItems()
	{ return this.items;	}
	public void setUserId(String userId)
	{ this.userId=userId;	}
	public String getUserId()
	{ return this.userId;	}
	public void clear()
	{ items.clear();	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -