AP Computer Science Amediummcq1 pt

A loop condition of i ≤ list.size() while calling list.get(i)

A.throws an IndexOutOfBoundsException on the last iteration
B.runs correctly
C.skips the first element
D.fails to compile

Explanation

Core Concept

get(size) is out of bounds.

Correct Answer

Athrows an IndexOutOfBoundsException on the last iteration

More Unit 7: ArrayList practice questions

Try a random question →

Practice more AP Computer Science A questions with full explanations

Practice Unit 7: ArrayList Questions →