Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    7
    Views
    1,142

    Re: Programme producing NullPointerException

    Yes that would give you a NPE.

    Does the code assign a value to the contents of the array BEFORE trying to use its contents?
    Make sure it is given a value before trying to use it.


    The array...
  2. Replies
    7
    Views
    1,142

    Re: Programme producing NullPointerException

    Not sure what the last post has to do with finding the variable with the null value.
    Have you found the variable with the null value yet?
  3. Replies
    7
    Views
    1,142

    Re: Programme producing NullPointerException

    Did you try printing out the contents of the array to see if it had any null entries?
    Also does scanner have a valid non-null value? Print it to see.
  4. Replies
    7
    Views
    1,142

    Re: Programme producing NullPointerException

    Please post the full text of the error message.
    To fix a NPE, look at the line where the error occurs, find the variable with the null value and backtrack to find out why that variable does not have...
Results 1 to 4 of 4