View Single Post
  #11 (permalink)  
Old 07-03-2008, 12:07 PM
coolnfunky_raj coolnfunky_raj is offline
Member
 
Join Date: Jul 2008
Posts: 6
coolnfunky_raj is on a distinguished road
Ok. I have written a code and it works as I want it to. Can you please tell me if there are any better ways of doing it?

for #1, I did
Code:
arrOfArr.add(arr); String tempStr[] = (String[])arr.toArray(new String[arr.size()]); arr = new ArrayList<String>( Arrays.asList(tempStr));
This solved the problem of arrOfArr getting deleted when arr.remove() was used to delete elements.



for #2, I did
Code:
String[][] dataOutput = new String[row][col]; for(i=0; i<row; i++) { tempArr = arrOfArr.get(i); tSize = tempArr.size(); for(j=0; j<tSize; j++) { dataOutput[i][j]=tempArr.get(j).toString(); } }
This helped me convert ArrayList of Arraylists to String[][]
Reply With Quote