I have a class that uses priority queue to display 5 strings in ascending order. I understand that to make it in descending order i can use the "collections.reverseOrder()" method. How use this method with the following code?
import java.util.*;
public class queue {
public static void main (String[] args) {
PriorityQueue<String> sQ = new PriorityQueue<String>();
sQ.add("theodore");
sQ.add("theo");
sQ.add("Shailee");
sQ.add("Deborah");
sQ.add("Fernando");
sQ.add("th");
while (sQ.size() > 0)
System.out.println(sQ.remove());
Collections.reverseOrder(); //I am stuck here...
}
}