Java collections and generics.
Collections Framework.
General DS:
Arrays
Linked list
Doubly linked list.
- Array / linked list can be used as stack, queue, heap.
Interface hierarchy.
- Lists
-- Lists
-- ArrayLists
-- Vectors
-- LinkedList
- Set
- Map
-- Hashmap
-- Sorting
- Sorting Collections
-- Comprable
-- Comparator
Joshua Bloch - created the collections framework.
The Collections class is implemented by set,list and queue. and holds a list of static methods to work on the collection of objects.
General methods in collection.
Add object
Remove object
Search / Find object.
Retrieve object
Iterate over objects.
Collections framework hierarchy.
List interface provides things like:
allows duplicates.
addObject
removeObject
iterate over them.
Set interface is about:
- Does not allow duplicates.
General DS:
Arrays
Linked list
Doubly linked list.
- Array / linked list can be used as stack, queue, heap.
Interface hierarchy.
- Lists
-- Lists
-- ArrayLists
-- Vectors
-- LinkedList
- Set
- Map
-- Hashmap
-- Sorting
- Sorting Collections
-- Comprable
-- Comparator
Joshua Bloch - created the collections framework.
The Collections class is implemented by set,list and queue. and holds a list of static methods to work on the collection of objects.
General methods in collection.
Add object
Remove object
Search / Find object.
Retrieve object
Iterate over objects.
Collections framework hierarchy.
List interface provides things like:
allows duplicates.
addObject
removeObject
iterate over them.
Set interface is about:
- Does not allow duplicates.