File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Certification Results and the fly likes urgent please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Certification Results
Bookmark "urgent please" Watch "urgent please" New topic

urgent please

anveshana bandu
Ranch Hand

Joined: Oct 09, 2007
Posts: 42
PriorityQueue<String> que=new PriorityQueue<String>();


output:::[roopa, swati, silpa]

mydoubt:::why did the elements in the list are not in sorted order??i feel silpa and swati should be that they will be in sorted order.
i understood the functionality of poll() and peek() doubt is in what order the elements are printed in case of strings if we print the whole collection that is queue.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Please take the time to choose the correct forum for questions; this one is for exam results: CarefullyChooseOneForum

You should also UseAMeaningfulSubjectLine.

This particular question was, amazingly enough, asked by someone else just minutes before you did, so let's continue the discussion in that thread. Goes to show that you should really search through the archive of posts before asking a question: SearchFirst
[ November 22, 2007: Message edited by: Ulf Dittmer ]
I agree. Here's the link:
subject: urgent please
jQuery in Action, 3rd edition