< Advanced Java
Collection Interface:
java.util.List
Ordered?Yes
AccessRandom
Access KeyIndex
Allow Duplicates?Yes
Standard Implementationsjava.util.ArrayList,
java.util.Stack (LIFO),
java.util.Vector

A List is a subinterface of java.util.Collection that keeps its elements ordered (like an array) and allows duplicate elements (also like an array). In fact, the main difference between an array and a list is that arrays are fixed-width, but lists can grow and shrink on demand.

Useful Methods

Standard Implementations

Subclassing List

This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.