Java PriorityQueue(SortedSet <? extends E > c) Constructor
Syntax
PriorityQueue(SortedSet <? extends E > c) constructor from PriorityQueue has the following syntax.
public PriorityQueue(SortedSet <? extends E> c)
Example
In the following code shows how to use PriorityQueue.PriorityQueue(SortedSet <? extends E > c) constructor.
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.TreeSet;
//ww w .j a va 2s .com
public class Main {
public static void main(String args[]) {
SortedSet<String> set = new TreeSet<String>();
PriorityQueue<String> p = new PriorityQueue<String>(set);
System.out.println(p);
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.util »
Java Tutorial »
java.util »