File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the diffrence b/w java.util.PriorityQueue.add(E e) and java.util.PriorityQueue.offer(E e)?

 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the diffrence b/w java.util.PriorityQueue.add(E e) and java.util.PriorityQueue.offer(E e)?
 
Neha Daga
Ranch Hand
Posts: 504
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
they both are same.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats because it's an unbounded queue. If you have a bounded queue the functions are not the same.
Add
Offer
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic