Can't seem to get my array table to show up :(
Hi guys, here's a link to a section of my code:
>>>> Link Removed<<<< Please post code here
Whenever i run my program, the inputs work, but I get this error saying
"Exception in thread "main" java.lang.NullPointerException
at game.printGrid(game.java:66)
at gameUser.main(gameUser.java:25)"
In my user class game, I call the method from the other class to show output. Here is my code of calling the method.
gameObject = new game(1, 2);
gameObject.enterValue();
gameObject.printGrid();
Re: Can't seem to get my array table to show up :(
Quote:
Exception in thread "main" java.lang.NullPointerException
at game.printGrid(game.java:66)
There is a variable with a null value at line 66 in the program. Look at line 66 and see what variable is null and backtrack in the code to see why that variable does not have a valid value. If you can not see which variable is null add a println statement just before line 66 and print out all the variables used on line 66.
Re: Can't seem to get my array table to show up :(
Look at the following line numbers in your code.
Quote:
at game.printGrid(game.java:66)
at gameUser.main(gameUser.java:25)"
Try to manipulate them logically and see what is the result in each steps. Use of a paper and pencil make sense a lot. Then you can find the solutions yourself while learning something new. If you don't know what is the exception means, please have a look at the Java Doc.