Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    17
    Views
    2,567

    Re: Help With Null Pointer Exception

    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...
  2. Replies
    17
    Views
    2,567

    Re: Help With Null Pointer Exception

    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));
  3. Replies
    17
    Views
    2,567

    Re: Help With Null Pointer Exception

    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...
  4. Replies
    17
    Views
    2,567

    Re: Help With Null Pointer Exception

    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...
  5. Replies
    17
    Views
    2,567

    Re: Help With Null Pointer Exception

    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...
  6. Replies
    17
    Views
    2,567

    Re: Help With Null Pointer Exception

    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...
  7. Replies
    17
    Views
    2,567

    Re: Help With Null Pointer Exception

    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...
Results 1 to 7 of 7