これは助けを求める少し型にはまらない方法かもしれませんが、コードでヌル ポインター ランタイム エラーが発生していますが、ランタイム エラーの範囲が大きすぎて、stackoverflow に投稿できません。私は本当にこれを理解したいので、何が間違っているのかを理解するために私のコードをメールで送信することは可能ですか? 実行時エラーがトリップしている特定の行番号を示していることは知っていますが、正直なところ、そこで発生している理由を頭や尾にすることはできません。どうもありがとうございました!!
スタックトレース:
java.lang.NullPointerException
at Maze.getNumRandOccupants(Maze.java:118)
at P4TestDriver.testMaze(P4TestDriver.java:995)
at P4TestDriver.main(P4TestDriver.java:116)
at __SHELL8.run(__SHELL8.java:7)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at bluej.runtime.ExecServer$3.run(ExecServer.java:814)
java.lang.NullPointerException
at Maze.addRandomOccupant(Maze.java:130)
at P4TestDriver.testMazeReadWrite(P4TestDriver.java:1071)
at P4TestDriver.main(P4TestDriver.java:127)
at __SHELL8.run(__SHELL8.java:7)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at bluej.runtime.ExecServer$3.run(ExecServer.java:814)