• Post Reply Bookmark Topic Watch Topic
  • New Topic

List and Indexed Collection in Java  RSS feed

 
Ranch Hand
Posts: 212
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?
 
author & internet detective
Sheriff
Posts: 38050
606
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!