Search:

Type: Posts; User: Junky

Search: Search took 0.30 seconds.

  1. Replies
    10
    Views
    2,161

    Re: Null Pointer Exception?

    Of course not since methods are method not constructors. If you do not understand the difference then you need to do some revision.
  2. Replies
    10
    Views
    2,161

    Re: Null Pointer Exception?

    I almost pointed you directly to the problem. Where is the constructor in the Truck class? It doesn't have one.
  3. Replies
    10
    Views
    2,161

    Re: Null Pointer Exception?

    The error is on line 85 of the Truck class which according to you is: choice[choiceCount++] = w;
    That means that the choice variable is null and has not been instantiated. "But it has been in the...
  4. Replies
    10
    Views
    2,161

    Re: Null Pointer Exception?

    Copy and paste the exact error message.
  5. Replies
    10
    Views
    2,161

    Re: Null Pointer Exception?

    The error message will tell on which line it occurs. Go to that line and examine all your variables to determine which is null. Then make sure it is not null before you try to use it.
Results 1 to 5 of 5