Java's "ArrayList
" seems like a contradiction to me. An array (static or dynamic) is certainly nothing like a list in a language like c++ or in computer science. What inherits from Java's List
and yet seems to be nothing like one is rather silly.
Questions:
ArrayList
? Is it a vector (dynamic array), or is it a linked list?ArrayList
chosen? Why was the name List
chosen for something that uses indexes to access elements and is sometimes random access (see here)?NB: I come from a c++ background where a list
is a linked list and vector
is a vector (self-adjusting dynamic array). Is this terminology different in other languages?
List
interface that is based on arrays. Therefore, it's an Array
List
.