aspose file tools*
The moose likes Beginning Java and the fly likes LinkedList and ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "LinkedList and ArrayList" Watch "LinkedList and ArrayList" New topic

LinkedList and ArrayList

Devi Hari

Joined: Oct 03, 2005
Posts: 7
what is the difference between LinkedList and ArrayList
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13872

They are different implementations of the List interface.

LinkedList works with a linked list behind the scenes. ArrayList works differently, it has an array behind the scenes.

For some operations, ArrayList is more efficient (such as lookups by index), and for other operations, LinkedList is more efficient (such as inserting or deleting entries).

Read the API documentation of ArrayList and LinkedList for more information.

If you have trouble choosing between the two, analyze your application and find out what kind of operations you're doing on your list. Choose the implementation that does the most frequently used operations the most efficiently.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24166

Devi --

First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. A single name isn't enough. You can change your display name here. Thanks!

Second, this is a beginner question, not an advanced one; I'm moving this thread to Java in General (Beginner) for any follow-up.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: LinkedList and ArrayList
Similar Threads
What is the difference between LinkedList and ArrayList ?
difference between arraylist and linkedlist?
Difference between ArrayList and LinkedList?
On what circumstances the ArrayList, LinkedList, Vector will be used.
about linked list and arraylist