Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

How do I change an Array of Objects to an ArrayList

  Asked By: Ryan    Date: Jul 23    Category: Java    Views: 941
  

How do I change an Array of Objects to an ArrayList

User-Agent: eGroups-EW/0.82
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Length: 765
X-Mailer: Yahoo Groups Message Poster
X-Originating-IP: 203.194.3.92
X-Yahoo-GPoster: 10sVyW1G3ehdraqS

Could someone please tell me how I would change this code sample from
an Array of Objects into an ArrayList ?

public static final int[] SIZE = {10, 15, 20, 25, 30, 35, 40, 45,
50, 55};

private void importData()
{
Xobject[] array1 = new Xobject[10];
for(int i = 0; i < 10; i++)
{
int x = SIZE[i];
array1[i] = new Xobject(x);
}

for(int row = 0; row < 12; row++)
{
float z = 0;
float array2[] = reader.getOneLine();
for(int column = 0; column < month.length; column++)
{
z = array2[column];
array1[row].arrayInXobject[column] = z;
}
}
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on How do I change an Array of Objects to an ArrayList Or get search suggestion and latest updates.




Tagged: