Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Vernon Day   on Jul 01 In Java Category.

  
Question Answered By: Anna Hill   on Jul 01

Thanks to those who helped with my last question, I've now managed to
put all the relevent objects into the ArrayList with the following:

public void  importData()
{
reader = new ReaderObject();
junkData = new ArrayList();
for(int i = 0; i < 10; i++)
{
int x = SIZE[i];
Xobject objectX = new Xobject(x);
double z = 0;
double temporaryArray[] = reader.getOneLine();
for(int column  = 0; column < temporaryArray.length; column++)
{
z = temporaryArray[column];
objectX.arrayInXobject[column] = z;
}
junkData.add(i, objectX);
}
}

But now how do I access the methods  inside of these objects in the
ArrayList ? This code  doesn't work:

public double  someMethod(int x, int  y)
{
this.x = x;
this.y = y;
double z = 0.0;
z = junkData.get(x, Xobject.anotherMethod(y));
return z;
}

Could someone please help me to fix this.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on an ArrayList Problem Or get search suggestion and latest updates.


Tagged: