File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes What is the Difference? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is the Difference?" Watch "What is the Difference?" New topic
Author

What is the Difference?

Aditi Gandy
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
May i know what is the difference between ArrayList and LinkedList? both are not synchronized !

Please help me


Thanks & Regards,
Author
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42910
    
  68
LinkedList implements the Queue interface, whereas ArrayList does not. ArrayList implements RandomAccess, though (which LinkedList does not). The javadocs of both classes talk some more about their respective advantages and disadvantages.
Max Rahder
Ranch Hand

Joined: Nov 06, 2000
Posts: 177
ArrayList is backed by an array. A LinkedList is a http://en.wikipedia.org/wiki/Linked_list. Once built, accessing elements by index from an ArrayList is much faster. For volatile lists, LinkedList is better. When building an ArrayList, make note of the ArrayList(int) constructor -- using that is important when creating large lists. :-)
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Aditi Gandy wrote:May i know what is the difference between ArrayList and LinkedList? both are not synchronized !

Same discuss here
Also see Deque which is double-ended queue.

The Deque interface extends from the Queue interface introduced with Java 5, and is the latest addition to the Java Collections Framework. Implementations of the interface include LinkedList, ArrayDeque and LinkedBlockingDeque.





http://muhammadkhojaye.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the Difference?