• Post Reply Bookmark Topic Watch Topic
  • New Topic

List and Indexed Collection in Java  RSS feed

 
Vaibhav Gargs
Ranch Hand
Posts: 116
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that ArrayList is indexed in Java because internally it utilizes the Arrays. But, are the linkedlist also indexed in Java?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37462
537
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. An LinkedList is both a List and a Queue. The List part makes it indexed. THat's what lets you say list.get(0). An ArrayList is indexed more efficiently in the implementation though.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!