4. Data Collections
Arraylist Methods — Quiz
Test your understanding of arraylist methods with 5 practice questions.
Practice Questions
Question 1
What is the main purpose of the add method for an ArrayList?
Question 2
What does the size method return for an ArrayList?
Question 3
If an ArrayList has $4$ elements, what is the index of the last element?
Question 4
What happens when remove is called with an index that is within the list range?
Question 5
Which method would you use to look at the element stored at a specific position without changing the list?
