What will happen if we change the ArrayList to a LinkedList in this snippet?
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
list.add(2);
for (Integer number : list) {
System.out.println(number);
}What will happen if we change the ArrayList to a LinkedList in this snippet?
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
list.add(2);
for (Integer number : list) {
System.out.println(number);
}Create a free account to access the full topic