What is the output of the following Java program?
import java.util.*;
public class Main {
public static void main(String[] args) {
List<Integer> l = new ArrayList<>(Arrays.asList(1, 2, 3));
try {
for (int x : l) {
if (x == 2) l.remove(Integer.valueOf(x));
}
} catch (ConcurrentModificationException e) {
System.out.print("E");
}
System.out.println(l);
}
}- A[1, 2, 3]
- BE[1, 3]
- C[1, 3]
- DE[1, 2, 3]
Correct answer: C