How to convert 2d string array into ArrayList??
I have a 2d array of string, how can i covert it to array list???
3 Answers
If you want a full list of elements just do this. Probably there is a simple way
ArrayList<String> list = new ArrayList<String>();
for (int i=0; i < array_limit ; i++)
for (int j=0 ; j < array_limit; j++)
list.add(your_array[i][j]);
2 Comments
Ahmad Abbasi
then how can i relate array itmes?? like how can I find array[2][1]??
maninder singh
@user1756754 if your array is xy then array[2][1]=list.get((y*2)+1)........ that is for any i and j array[i][j]=list.get((yi)+j)