Thursday, February 9, 2012

Java Basics - Must Know The Differences

Java Collections :

List :

Ordered
Contain duplicates


Vector :
Growable array
Synchronized
Multi thread
Default size to 10


Set :
Unordered
No duplicates 


Hashtable :
Key-value
Synchronized
No NULLS
Ordered
Use enumerator


Arraylist :
Heterogeneous
Unsynchronized
Allow NULLS
Uses array structure to store
No default size


Map :
Interface
Associate key with Value


Hashmap :
No order
Unsynchronized
Allow NULLS
Use Iterator
Default size is 8


LinkedList :
Faster to insert/delete in between.
 

1 comment: