Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Comparator; import java.util.PriorityQueue; import java.util.SortedSet; public class Main { public static <E> PriorityQueue<E> getPriorityQueue() { return new PriorityQueue<E>(); } public static <E> PriorityQueue<E> getPriorityQueue(int initialCapacity) { return new PriorityQueue<E>(initialCapacity); } public static <E> PriorityQueue<E> getPriorityQueue(Collection<? extends E> collection) { return new PriorityQueue<E>(collection); } public static <E> PriorityQueue<E> getPriorityQueue(int initialCapacity, Comparator<? super E> comparator) { return new PriorityQueue<E>(initialCapacity, comparator); } public static <E> PriorityQueue<E> getPriorityQueue(PriorityQueue<? extends E> queue) { return new PriorityQueue<E>(queue); } public static <E> PriorityQueue<E> getPriorityQueue(SortedSet<? extends E> set) { return new PriorityQueue<E>(set); } }