AP Computer Science Aeasymcq1 pt

The expression a[a.length - 1] accesses

A.the last element
B.the first element
C.an out of bounds index
D.the array length

Explanation

Core Concept

The last index is length minus one.

Correct Answer

Athe last element

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 →