我在转换整数向量时遇到问题,如下所示。转换字符串没问题,但我遇到了整数问题。
private Vector a = new Vector();
Record record = new Record();
record.setName((String) listName.elementAt(i));
record.setPrice((int) listPrice.elementAt(index));
a.addElement(record);
下面是上课记录
package goldenicon;
public class Record {
String name;
int price;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
}