File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes what is the diffrence b/w java.util.PriorityQueue.add(E e) and java.util.PriorityQueue.offer(E e)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "what is the diffrence b/w java.util.PriorityQueue.add(E e) and java.util.PriorityQueue.offer(E e)?" Watch "what is the diffrence b/w java.util.PriorityQueue.add(E e) and java.util.PriorityQueue.offer(E e)?" New topic
Author

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

Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

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


SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
Neha Daga
Ranch Hand

Joined: Oct 30, 2009
Posts: 504
they both are same.


SCJP 1.6 96%
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Thats because it's an unbounded queue. If you have a bounded queue the functions are not the same.
Add
Offer


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
 
subject: what is the diffrence b/w java.util.PriorityQueue.add(E e) and java.util.PriorityQueue.offer(E e)?