Given:
11. public static Iterator reverse(List list) {
12. Collections.reverse(list);
13. return list.iterator();
14. }
15. public static void main(String[] args) {
16. List list = new ArrayList();
17. list.add(“1”); list.add(“2”); list.add(“3”);
18. for (Object obj: reverse(list))
19. System.out.print(obj + “, “);
20. }
What is the result?
A.
1, 2, 3,
B.
The code runs with no output.
C.
Compilation fails.
D.
An exception is thrown at runtime.
E.
3, 2, 1,