I have a list of String lists initialised to object1 as mentioned below:
List<List<String>> object1 = Arrays.asList(Arrays.asList("A", "B", "C"),
Arrays.asList("D", "E", "F"),
Arrays.asList("G", "H", "I"));
Now I want to create a new list of String lists object let be object 2 as mentioned below:
List<List<String>> object2 = new ArrayList<>();
I am not sure whether above written syntax is correct while creating new object "object2" which is same as "object1".
I want to iterate each and every element present in object1 and store in object2 using two for loops (outer and inner loop).
I tried to refer lot of examples but not able to get proper implementation for it.