The following snippet throws an Exception in printin part....
ArrayList<ArrayList<Integer>> a = new ArrayList<ArrayList<Integer>>(5);
for(int i = 0 ; i < a.size() ; i++){
a.set(i, new ArrayList<Integer>(10));
}
System.out.println(a.get(a.size()-1).get(9));//exception thrown
can anyone explain why...
thanks in advance...