for (int i = 1; i <= list.size(); i++) {
System.out.println(list.get(i));
}What is the bug?
- A
ArrayList lacks a get method
- B
Nothing is wrong
- C
println cannot accept an Object
- Dcheck_circle
Indices start at 0 and end at size()-1; should be i = 0; i < list.size()
Explanation
Java collections are zero-indexed. Starting at 1 skips the first element and going through size() throws IndexOutOfBoundsException.