Search:

Type: Posts; User: Gambleee_

Search: Search took 0.14 seconds.

  1. Replies
    4
    Views
    584

    Re: NullPointerException help with array

    Fixed the original error by adding = new int[20] to the end of private int[] array. This solved the error because i hadn't created the array itself or set a value for the size,
  2. Replies
    4
    Views
    584

    Re: NullPointerException help with array

    Exception in thread "main" java.lang.NullPointerException
    at Deb1.allocate(Deb1.java:20)
    at TestDeb1.main(TestDeb1.java:12)

    This may not be accurate as i removed some of the comments when...
  3. Replies
    4
    Views
    584

    NullPointerException help with array

    Hi i'm new to Java, when running the following test class on deb1 i get a NullPointerException. Can someone explain how to fix my array?

    Deb1:



    public class Deb1
    {
    private int[]...
Results 1 to 3 of 3