Variable not retaining value
Hi,
So I delcared a couple arrayLists at the top of my program just under the public Class classname{. I assigned values to these arrayLists in a method called onEnable(). When I create a seperate method for each of these like: Code:
public int[] getArray() {
int[] arrayInt = new int[array.size()];
for (int i=0; i < arrayInt.length; i++)
{
arrayInt[i] = array.get(i).intValue();
}
System.out.println("in array: " + arrayInt.length );
return arrayInt;
}
the elements of the array get reset to default values. How to i declare my varibles so they retain their values through methods?