Section 16.6 Lists
• A List (p. 694) is an ordered Collection that can contain duplicate elements.
• Interface List is implemented by classes ArrayList, LinkedList and Vector. ArrayList (p. 688) is a resizable-array implementation. LinkedList (p. 688) is a linkedlist implementation of a List.
• Java SE 7 supports type inferencing with the <> notation in statements that declare and create generic type variables and objects.
• Iterator method hasNext (p. 691) determines whether a Collection contains another element. Method next returns a reference to the next object in the Collection and advances the Iterator.
• Method subList (p. 694) returns a view into a List. Changes made to this view are also made to the List.
• Method clear (p. 694) removes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access