« Home | Mysql cluster & replication. » | Finding prime numbers with in a given number n. » | Javascript performance. » | Sorting algorithms. » | Multi tenant challenges. » | Web application security. » | Another short but beautiful game I won. » | Javascript dom » | Javascript. » | Loading scripts asynchronously. » 

Wednesday, January 04, 2012 

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.