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 ...
Get Java™ How To Program (Early Objects), Tenth 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.