Null Pointer Exception
<p>I am working on some project in java. 
Here I'm stuck at this problem and not able to figure out where I am going wrong. </p>

<p>I have made two classes: <code>Test</code> and <code>Child</code>. </p>

<p>When I run the code I am get a NullPointerException.</p>

<pre><code>package test;

public class Test {

    child newchild = new child();

    public static void main(String[] args) {

        new Test().method();
    }

    void method() {
        String[] b;
        b = newchild.main();
        int i = 0;
        while (i &lt; b.length) {
            System.out.println(b[i]);
        }
    }
}
</code></pre>

<hr>

<pre><code>package test;

public class child {

    public String[] main() {

        String[] a = null;
        a[0] = "This";
        a[1] = "is";
        a[2] = "not";
        a[3] = "working";
        return a;

    }
}
</code></pre>
