My code compiles but it has a java null error.
import java.util.Arrays;
public class Example
{
private int[] NumberArray;
public Example()
{
int[] NumberArray = new int[4];
}
public void setNumberArray()
{
NumberArray[0] = 20;
NumberArray[1] = 15;
NumberArray[2] = 22;
}
public void printnumberArray()
{
for(int index=0; index < NumberArray.length; index++)
{
System.out.println(NumberArray[index]);
}
}
}