Sunteți pe pagina 1din 1

All collections implements Collection interface

List ArrayList

LinkedList

HashSet
Set no duplicates
02- Defining & Iterating Collections
TreeSet
SortedSet
ArrayDeque
Deque
FIFO & LIFO
FIFO LinkedList
Queue
PriorityQueue
SortedMap
TreeMap
Map
HashMap

collection: container of zero or more elements


Collections are iterable

toString representation is not good The Problems with an Array

add: arrays dont resize ArrayList


01- Introduction 03- Lists
Duplicates: unique elements when we add Java Collections
part of JDK LinkedList

implementing data structures can be hard


Why Collections

Collection of distinct elements, no duplicates

HashSet
based upon HashMap, look for hashCode method

04- Sets
TreeSet

S-ar putea să vă placă și