What is the output of the following code snippet?
3: java.util.List<Integer> list = new java.util.ArrayList<Integer>(); 4: list.add(10); 5: list.add(14); 6: for(int x : list) { 7: System.out.print(x + ", "); 8: break; 9: }
C.
This code does not contain any compilation errors or an infinite loop, so options D, E, and F are incorrect.
The break statement on line 8 causes the loop to execute once and finish, so option C is the correct answer.