I'm getting the error:
non-static variable arrayInxObject cannot be referenced from a static
context
On the following line of code:
junkData.set(y, xObject.arrayInxObject[column] = z);
Could someone please point out to me the exact problem, and possibly a
solution
The below is a sample of the code this line was taken from:
public class Junk
{
public static final int[] SIZE = {5, 10, 20, 25, 30, 35, 40, 45,
50, 55};
private ArrayList junkData;
private ReaderObject reader;
public Junk()
{
importData();
}
public void importData()
{
reader = new ReaderObject();
junkData = new ArrayList();
for(int i = 0; i < 10; i++)
{
int x = SIZE[i];
junkData.add(i, new xObject(x));
}
for(int y = 0; y < 10; y++)
{
double z = 0;
double temporaryArray[] = reader.getOneLine();
for(int column = 0; column < temporaryArray.length; column++)
{
z = temporaryArray[column];
junkData.set(y, xObject.arrayInxObject[column] = z);
}
}
}
// other methods removed
}
public class xObject
{
public double[] arrayInxObject;
public xObject(int size)
{
arrayInxObject = new double[size];
}
// other methods removed
}