Did the location of the NPE change?
Why didn't the value of shield[row][col] print?
When posting what is printed on the console by the program including the error message, you should copy and...
Type: Posts; User: Norm
Did the location of the NPE change?
Why didn't the value of shield[row][col] print?
When posting what is printed on the console by the program including the error message, you should copy and...
Print out the values of: shield[row][col], row and col
also print out the contents of the shield array:
System.out.println("shield="+Arrays.toString(shield));
Sorry, what you said makes no sense.
What prints out when you print the values of all the variables on line 123 where the NPE happens?
Can you post the code for line 123 and the println...
If you know that a variable can have a null value, you should check for that first before using the variable in the rest of the if statement.
Do you know which variable has the null value?
You...
In Drawable2D at line 123 (called from Shield line 103) there is a variable with a null value. Look at line 123, find the variable with the null value and then backtrack in the code to find out why...
Please copy and paste here the full text of the error message, It says where the error happens.
If theShield variable has a null value, where in the code is it supposed to get a valid value? Is...
Look at the line where the NPE occurred and find the variable with the null value. If you can't see what variable is null, add a println just before the line with the NPE and print out the values of...