Tuesday, June 29, 2010

Describe ArrayList, Vector, LinkedList?

ArrayList:it is ordered but not sorted.it gives fast iteration and fast RandomAccess. it implements RandomAccess interface. choose this over a LinkedList when you need fast iteration. but use not as likely to be doing a lot of insertion,deletion.

Vector:Vector,HashTable were the two original collection in before java2..
->Vector methods are Synchronized for thread safety.
->Vector also implements RandomAccess
->if ArrayList wants to thread safety it can use Collection(class) utility methods.

LinkedList:
->it is ordered by index position
->it is doubly Linked to one another.
->LinkedList is implemented by queue so it now supports peck(),poll(),offer().

No comments:

Post a Comment