AP Computer Science Aeasymcq1 pt

Given int[] a = {1, 2, 3}, accessing a[3] causes

A.an exception
B.0 to be returned
C.3 to be returned
D.a compile error

Explanation

Core Concept

Index 3 is out of bounds for length 3.

Correct Answer

Aan exception

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 →