AP Computer Science Amediummcq1 pt
Which expression finds the last element of a nonempty Integer list?
A.list.get(list.size() - 1)
B.list.get(list.size())
C.list.get(0)
D.list.size() - 1
The last index is size minus one.
Alist.get(list.size() - 1)
Practice more AP Computer Science A questions with full explanations
Practice Unit 7: ArrayList Questions →