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

📄 goodscar.java

📁 这是一本介绍JSP技术的资料
💻 JAVA
字号:
package bcs;

import java.util.*;
import java.io.*;
public class GoodsCar implements Serializable
{ Hashtable list=new Hashtable();
String item="";
int mount=0;
String unit="";
public GoodsCar()
{ 
}
public void setItem(String newItem)
{
	try{
	item=new String(newItem.getBytes("ISO8859_1"));
	}
	catch(Exception e)
	{
}
}
public void setUnit(String newUnit)

	{
	try{
	unit=new String(newUnit.getBytes("ISO8859_1"));
	}
	catch(Exception e)
	{
}
}
public void setMount(int m)
{mount=m;}
public void addGoodstoCar()
{
String str="商品名称:"+item+" 数量:"+mount+"单位:"+unit;
try{	
String things=new String(str.getBytes("GB2312"));
list.put(item,things);
}
catch(Exception e)
	{}
}
public Hashtable listGoods()
{
return list;
}
public void deleteGoods(String s)
{
   try{
	String DeleteItem=new String(s.getBytes("GB2312"));
	list.remove(DeleteItem);
	}
	catch(Exception e)
	{}	
	}
}

⌨️ 快捷键说明

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