ArrayList au = new ArrayList();
String[] name = new String[3];
name[0] ="test";
name[1] = "test1";
name[2] = "test2";
for(int i=0;i<3;i++) {
au.add(name[i]);
}
In case of an Object array:
list = java.util.Arrays.asList(array);
In case of a primitive or an Object array:
for (int i = 0, len = java.lang.reflect.Array.getLength(array);i < len;i++) {
list.add(java.lang.reflect.Array.get(array, i));
}
B4 J2SE 5.0
ArrayList alist = new ArrayList();
String str[] = {"hello","hi","Heh"};
alist.add(str);
String str1[] = (String[])alist.get(index);
from J2SE 5.0
ArrayList<String[]> alist = new ArrayList<String[]>();
String str[] = {"hello","hi","Heh"};
alist.add(str);
String str1[] = alist.get(index);
>adding arrayobject to arraylist
wat does "arrayobject" indicate it could be a Object[],String[],Integer[] or .........
i've just taken an example of String[] out of those alternative.
I'm no magician and so do you...
Hope there are to hard issues...
U Have a gr8 day.. :)
REGARDS,
RaHuL