请问我这段代码向Arraylist中添加自定义的对象为什么老是报错啊?
部分代码:
.
.
.
public static ArrayList alI;
String word;
word = this.getTOKEN(this.arrayExe, this.record);
alI.add(new Int(word));//将声明的int变量加入alI
.
.
.
/**Int类如下**/
public class Int {
String name;
int value;
public Int(String name){
this.name = name;
this.value = 0;
}
}