Java改错 javabean包有错误,改完能编译来,不懂装懂永是饭桶,勿喷!package chap7.text;import javax.servlet.http.*;import java.util.Vector;import java.util.Enumeration;public class ShoppingCar{Vector v=new Vector();String submit=null;S
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 06:51:18
Java改错 javabean包有错误,改完能编译来,不懂装懂永是饭桶,勿喷!package chap7.text;import javax.servlet.http.*;import java.util.Vector;import java.util.Enumeration;public class ShoppingCar{Vector v=new Vector();String submit=null;S
Java改错 javabean包有错误,改完能编译来,不懂装懂永是饭桶,勿喷!
package chap7.text;
import javax.servlet.http.*;
import java.util.Vector;
import java.util.Enumeration;
public class ShoppingCar
{
Vector v=new Vector();
String submit=null;
String item=null;
public void AddItem(String name)
{
v.addElement(name);
}
public void RemoveItem(String name)
{
v.removeElement(name);
}
public void setSubmit(String name)
{
item=name;
}
public void setSubmit(String s)
{
submit=s;
}
public String[ ] getItem()
{
String[ ] s=new String[v.size() ];
v.copyInto(s);
return s;
}
public void reset()
{
submit=null;
item=null;
}
}
Java改错 javabean包有错误,改完能编译来,不懂装懂永是饭桶,勿喷!package chap7.text;import javax.servlet.http.*;import java.util.Vector;import java.util.Enumeration;public class ShoppingCar{Vector v=new Vector();String submit=null;S
public void setSubmit(String name)
{
item=name;
}
public void setSubmit(String s)
{
submit=s;
}
这两个方法名一样了,并且传入的数据类型也一样.
要么改名,要么改参数.