D
Damo
Hi,
I have an ArrayList of ArrayLists. I want to extract all the lists,
but I dont know how many ArrayLists will be in the ArrayList.
I know I can do it if i know how many lists are there using the
ArrayList get() method.
this is how i'm doing it
List<String> list1 = new ArrayList<String>();
list1 = res.get(0);
List<String> list1 = new ArrayList<String>();
list2 = res.get(1);
List<String> list1 = new ArrayList<String>();
list3 = res.get(2);
But if theres only two lists in the list i get a NullPointerException
Is there any way i can loop through the list and extract the lists
thanks
I have an ArrayList of ArrayLists. I want to extract all the lists,
but I dont know how many ArrayLists will be in the ArrayList.
I know I can do it if i know how many lists are there using the
ArrayList get() method.
this is how i'm doing it
List<String> list1 = new ArrayList<String>();
list1 = res.get(0);
List<String> list1 = new ArrayList<String>();
list2 = res.get(1);
List<String> list1 = new ArrayList<String>();
list3 = res.get(2);
But if theres only two lists in the list i get a NullPointerException
Is there any way i can loop through the list and extract the lists
thanks