Replacing ArrayList with LinkedList

Report a typo

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);
}
Select one option from the list
___

Create a free account to access the full topic