Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

LinkedList and ArryList  RSS feed

 
rajesh kumar rayavarapu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between LinkedList and ArryList?

pls tell me it's urgent
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16026
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lookup the API documentation of those classes; it explains exactly how each of the classes works. Also read the documentation on the collections framework.

"pls tell me it's urgent"
Ease Up
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rajesh kumar rayavarapu:
...pls tell me it's urgent

"It's urgent."
 
Dinesh Arora
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are both a part of Collection framework(LIST). Each ahs it's own advantage and disadvantage-

If you want a quick retreival of objects, use ArrayList.
If you have to do plenty of additiona and deletion, you can use Linked list
ArrayList does not maintain any order while inserting.
LinkedList manitian insertion order and can also sort itslef optionally to most recently access value.

It's a designing factor you might need to consider to improve the performance of a application/project.

Thanks,
Dinesh

SCJP 1.4
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ArrayList does not maintain any order while inserting.


Thats incorrect. All implementations of the List contract maintain a well defined order.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!