主方法.java
public class mainMethod{
public animalsData[] animals;
public mainMethod(){
animals[this.animals.length + 1] = new animalsData("CAT", "4");
}
public static void main(String[] args) {
mainMethod run = new mainMethod();
}
}
动物数据.java
public class animalsData{
String name, l;
public animalsData(String name, String l) {
super();
this.name= name;
this.l= l;
}
}
我有这个问题:线程“主”java.lang.NullPointerException中的异常