Im trying to create a Three Dimensional List that looks like this:
Main List
-List1
-Sublist1
-Sublist2
-Sublist3
-List2
-Sublist1
-Sublist2
-List3
-Sublist1
-Sublist2
-Sublist3
-Sublist4
With this, let's say I want to access the element "List2, Sublist1", I want to get the access like using list.get(0).get(1).get(0)
I know that I can create a list of lists, using the following code
List<List<Integer>> lists = new ArrayList<List<Integer>>();
for (int i = 0; i < 4; i++) {
List<Integer> list = new ArrayList<>();
lists.add(list);
}
Is there a way to create a Three Dimensional List? Or in which way should I try to do this?