ArrayList is implemented with an array to store the elements of the list. LinkedList is implemented as a doubly-linked list.
Which one you should use depends on how you use the list. An ArrayList is faster when you need to lookup an element at a known index in the list, but slower when you insert elements in the list. A LinkedList is slower when looking up an element at a known index in the list, but faster when you insert elements in the list.
Originally posted by raghu nagabandi: ArryList: we will use ArrayList in following cases if the requirement contains more retrival operation then we have to use ArrayList
Only for random access. If we always iterate through all elements of a list in order, a LinkedList should be just fine (although still a little bit slower).
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus