Why am I getting a null pointer exception here?
<p>I am using java. The second line of this code is getting a null pointer exception.</p>

<pre><code>double gpa = 0.0;
gpa = grads[index].calculateGPA();
return gpa;
</code></pre>

<p>grads is an array of Graduate objects. I have tested this method in a JUnitTest and it works fine. I have also tested calculateGPA(). Only when I run the program there is an error.</p>
