Saturday, 31 August 2013

Java - instantiating ArrayList of ArrayLists

Java - instantiating ArrayList of ArrayLists

I want to instantiate an ArrayList of ArrayLists (of a generic type), I
have this code:
private ArrayList<ArrayList<GameObject>> toDoFlags;
toDoFlags = new ArrayList<ArrayList<GameObject>>(2);
Am I doing this right? it compiles but when I look at the array it seems
as if it has 0 length.
Thanks.

No comments:

Post a Comment