为什么老师的代码在我这里会出错呢
jar包我也都考了,代码完全一样,怎么下面这两行代码老师不能执行呢
g.getStudents().add(stu1);
g.getStudents().add(stu2);
Exception in thread "main" java.lang.NullPointerException
at com.imooc.test.Test.update(Test.java:64)
at com.imooc.test.Test.main(Test.java:21)
jar包我也都考了,代码完全一样,怎么下面这两行代码老师不能执行呢
g.getStudents().add(stu1);
g.getStudents().add(stu2);
Exception in thread "main" java.lang.NullPointerException
at com.imooc.test.Test.update(Test.java:64)
at com.imooc.test.Test.main(Test.java:21)
2016-02-12
举报