Win a copy of Murach's Python Programming this week in the Jython/Python 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)?  RSS feed

 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
they both are same.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • 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
Boost this thread!