posted 12 years ago

My problem is

for(int i=0;i<10;i++)

{

DNewRow.add(i,NewRow);

}

Here NewRow,DNewRow is Arraylist , so for the i'th index, the NewRow arrayList will be stored,like that for every index of the i'th value NewRow will be added to DNewRow.

now i want to reterive that value, c in 2d array we will retrive as follows

for(int i=0;i<arr[].lenght;i++){

for(int j=0;j<arr2[].lenght;j++){

SOP(New2D[i][j]);

}

How i can reteiver for ArrayList, plz hepl me

kalai

for(int i=0;i<10;i++)

{

DNewRow.add(i,NewRow);

}

Here NewRow,DNewRow is Arraylist , so for the i'th index, the NewRow arrayList will be stored,like that for every index of the i'th value NewRow will be added to DNewRow.

now i want to reterive that value, c in 2d array we will retrive as follows

for(int i=0;i<arr[].lenght;i++){

for(int j=0;j<arr2[].lenght;j++){

SOP(New2D[i][j]);

}

How i can reteiver for ArrayList, plz hepl me

kalai

posted 12 years ago

Do you know how to get an element from a "1D" ArrayList? If so, you basically do the same thing twice witha "2d" ArrayList. It sounds like you might need some more help with the Collections Framework in general. you should take a look at the Collections Trail from Sun's Java Tutorial. You should also take the time to become intimately familiar with the API documentation for the version of Java you are using.

After reviewing the links I have given above, please come back with more questions if anything is still unclear.

Layne

After reviewing the links I have given above, please come back with more questions if anything is still unclear.

Layne

Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |