Java tutorial
import java.util.Collections; import java.util.PriorityQueue; public class Main { public static void main(String args[]) { PriorityQueue<Integer> prq = new PriorityQueue<Integer>(10, Collections.reverseOrder()); for (int i = 0; i < 10; i++) { prq.add(i); } PriorityQueue<Integer> p = new PriorityQueue<Integer>(prq); System.out.println(prq); } }