What does the following code output?
public static void main(String[] args) { List<String> c = Arrays.asList("A", "B"); for (int type = 0; type < c.size();) { System.out.print(c.get(type) + ","); break; } System.out.print("end"); }
A.
The first time through the loop, the index is 0 and A, is output.
The break statement then skips all remaining executions on the loop and the main()
method ends.
If there was no break keyword, this would be an infinite loop.