1//using enhanced-for loop to iterate over two dimensional ArrayList
2List<List<T>> items = new ArrayList<>(Arrays.asList(
3 Arrays.asList(T ...items),
4 Arrays.asList(T ...items1),
5 Arrays.asList(T ...items2)
6 ));
7
8for (List<T> arr : items) {
9 for (T item : arr) {
10 System.out.print(item + " ");
11 }
12 System.out.println();
13 }
14