what is the difference between ArrayList and LinkedList?

haneefnb
haneefnb used Ask the Experts™
on
Hi , plz tell me what is the difference b/w ArrayList and LinkedList? why we go for LinkedList, instead of ArrayList
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
ArrayList is backed by an array. LinkedList is good for use as a queue or where deletions from the head are required
Top Expert 2016

Commented:

Author

Commented:
Tell me the schenario which to use when?
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Top Expert 2016

Commented:
>>Tell me the schenario which to use when?

Well i just have ;-) You can use one for your own queue
Mick BarryJava Developer
Top Expert 2010

Commented:
arraylist is good for getting and setting items by index
linkedlist is best when you only need to access objects at the head/tail
Java Developer
Top Expert 2010
Commented:
you'll find a good discussion of difference here
http://www.javafaq.nu/java-article1111.html
Top Expert 2016

Commented:
haneefnb, can you explain why you ignored all comments but the last please?
Mick BarryJava Developer
Top Expert 2010

Commented:
(-:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial