I have a 2D-array in a class, and methods that affect the array.
From another class I can call a method to add to the array which works fine.
My method to get a value from an array is:
public int getValue(int col, int row){ return myArray[col][row]; }
I can call it in that class and it works fine (returns correct int), but from another class I always get a null pointer exception. All other methods work from another class (ie to set a value in the array). Why cant I return the value?
int Number = class.getValue(); -- null pointer.