File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ArrayList and LinkedList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ArrayList and LinkedList" Watch "ArrayList and LinkedList" New topic

ArrayList and LinkedList

Tom Tang
Ranch Hand

Joined: Dec 24, 2000
Posts: 133
What's the difference between ArrayList and LinkedList? If we don't care about speed, it seems to me that LinkedList can replace Arraylist anywhere. Is it also true vice versa? What standard can we use when deciding to use ArrayList or LinkedList?

Sun Certified Java Programmer
George Toronto
Ranch Hand

Joined: Dec 30, 2000
Posts: 78
In my view, the different points are the following:
1)Positional access has constant time performance in ArrayList and VEctor, but linear time in LinkedList.
2)in most cases the primary implementation ArrayList is the best choice for implementing listd. Where frequent insertions and deletions occur inside a list, a LinkedList can be worth considering.
I agree. Here's the link:
subject: ArrayList and LinkedList
It's not a secret anymore!