Originally posted by Donna Bachner:
I have two classes. The first has 4 arrays I would like to use in the other class. What is the syntax for doing this I keep getting a nullpointer exception. The one class is called Final and the other is Project.
for(int i = 0; i< Final.arr.length; i++)
{
g.setColor(Color.BLUE);
g.drawOval((int)Final.arr[i], (int)Final.arr2[i], 10,10);
}
From your code I see that arr is a static member of Final class. May be we'll have better idea, if you post code of Final class as well.
NullPointerException comes when the object you are trying to use has not been intialized. Make sure that arr is intialized properly in Final class (during declaration or in static{} block).
Jass