List

List is an interface that requires the implementing class to keep track of the order of the elements. There are also methods that access an element by index and iteration defined by the Collection interface that guarantees the order of the elements. The interface also defines the listIterator method that returns an Iterator also implementing the ListIterator interface. This interface provides methods that let the caller insert elements to the list while iterating through it and also going back and forth in the iteration. It is also possible to search for a certain element in the List, but most implementations of the interface provide poor performance while the search is simply going through all elements until the element searched for ...

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.