How do we retrieve the fifth element of an ArrayList?

myList.get(4)myList.remove(5)myList[4]myList[5]

Perfect! Like arrays, ArrayLists are zero-based but they differ in that they have methods like get() to retrieve elements.

Not quite! Like arrays, ArrayLists are zero-based but they differ in that they have methods like get() to retrieve elements.