AP Computer Science Amediummcq1 pt

A loop condition of i ≤ a.length while accessing a[i]

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

Explanation

Core Concept

a[a.length] is out of bounds.

Correct Answer

Athrows an exception at the last iteration

More Unit 6: Array practice questions

Try a random question →

Practice more AP Computer Science A questions with full explanations

Practice Unit 6: Array Questions →