...

View Full Version : Converting a Arraylist to a 2-D array



mars123
12-06-2007, 08:09 AM
I have an arraylist as below:


ArrayList listArray = new ArrayList();
listArray.add("Germany");
listArray.add("Holland");
listArray.add("Sweden");
listArray.add("India");

Now i want to convert this list or add the above elements of the list to an two-dimensional array as below:

(Germany,Holland)
(Sweden,India)

How can i add the list items to a 2-D array in above manner.

The toArray method returns single dimension array.

Thanks in advance.

shyam
12-06-2007, 02:36 PM
theres no predefined API call to do this...so, u'll have to write ur own



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum