在我的课堂上,我定义:
private ArrayList<BlockObject> blocks;
然后:
blocks.add(new BlockObject(x, y));
但是我收到此错误
02-22 17:06:52.672: E/AndroidRuntime(479): Caused by: java.lang.NullPointerException
02-22 17:06:52.672: E/AndroidRuntime(479): at com.comp1008.hhh.uuu.Scenario.blocks(Scenario.java:41)
有什么建议吗?