Object[]
isn't a list, it's an array.
Arrays in Java are allocated in contiguous blocks of memory and so indexing into them (myArray[3]
) is very efficient. They're storage-efficient too (not a lot of overhead).
Lists are different things, and in fact there is no implementation of List<Object>
; that's an interface, an abstract way of dealing with a list. There's LinkedList<Object>
and ArrayList<Object>
, etc., which are actual implementations of the interface with different trade-offs between various operations -- indexing into the list, traversing it, modifying it, etc. -- and between how much storage overhead they introduce.
Arrays are great when you're not going to change how many elements are in the array much at all; lists are great when you'll need to change how many elements there are.