Win a copy of The Java Performance Companion this week in the Performance 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
  • 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
Saloon Keeper
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