Home When to use LinkedList over ArrayList in Java?
Reply: 0

When to use LinkedList over ArrayList in Java?

user6885 Published in September 19, 2018, 3:46 am

I've always been one to simply use:

List<String> names = new ArrayList<>();

I use the interface as the type name for portability, so that when I ask questions such as these I can rework my code.

When should LinkedList be used over ArrayList and vice-versa?

share|improve this question
  • 1
    See also: Array versus linked-list – Hawkeye Parker Oct 12 '16 at 3:58
  • Just see the quote from the author of LinkedList stackoverflow.com/a/42529652/2032701 and you'll get a practical sense of the issue. – Ruslan Dec 26 '17 at 19:17

30 Answers 30

active oldest votes
up vote 2874 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.776453 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO