Sum all integers in <code>ArrayList<Integer> list</code>:
- Acheck_circle
for (int x : list) sum += x;
- B
Both work; first is enhanced-for, second uses size()
- C
for (int i = 0; i < list.length; i++) sum += list[i];
- D
Cannot iterate
Explanation
First works (with auto-unboxing); second has wrong syntax (use <code>list.size()</code> and <code>list.get(i)</code>).