NullPointerException even though variable has been initialised?

The code in the third line clearly defines the variable, but the console says it has not been initialised. What's wrong here?

IntList drawfoodvalues(IntList X, IntList Y, int grid){
    IntList allowed = new IntList();
    int tempX = X.size();

tempX is defined as the size of IntList X.

Tagged:

Answers

Sign In or Register to comment.