Here is my code :
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<ArrayList<Integer>> arrayLists = new ArrayList<ArrayList<Integer>>();
arrayLists.get(0).add(100);
arrayLists.get(0).add(50);
arrayLists.get(1).add(67);
System.out.println(arrayLists.get(0).get(0));
}
}
And this is the error message:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at Main.main(Main.java:6)
I didnt understand the problem.
`) is just an empty `List` waiting for `List` instance to be added in;: