• Post Reply Bookmark Topic Watch Topic
  • New Topic

collection  RSS feed

 
meeta gaur
Ranch Hand
Posts: 305
Notepad Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LinkedList and Deque both are doubly-linked,

we can have insertion and deletion at both ends

then what is difference ?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deque is an interface. LinkedList is a class that implements that interface. So, a LinkedList is a Deque.
 
Mansukhdeep Thind
Ranch Hand
Posts: 1163
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well for starters, Deque is an interface and LinkedList is a class. If you see the documentation carefully across 1.7, 1.6, 1.5, LinkedList implements Queue since java 1.5. It provides additional methods for poll and peek functionalities. Before that I don't think it had queue functionality. Others might give more insight into the matter.
 
Campbell Ritchie
Marshal
Posts: 56553
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct; I couldn’t find the Queue interface in the J2SE1.4.2 documentation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!