AP Computer Science Aeasymcq1 pt

Which statement accesses the first element of list?

A.list.get(0)
B.list.get(1)
C.list.get(list.size())
D.list.get(-1)

Explanation

Core Concept

The first index is 0.

Correct Answer

Alist.get(0)

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 →