Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Custom order of priority queue

807607Oct 31 2006 — edited Oct 31 2006
I am a novice in Java. I intend to use a priority queue which holds objects. The objects have a string and two integers. I have to order the priority queue based on one of the integer.

I write syntax according to my understanding please correct me.
PriorityQueue<Object> pr = new PriorityQueue<Object>();

comparable(){
sort(Object.int2)// this is the place where I am confused
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2006
Added on Oct 31 2006
4 comments
276 views