package com.logicbig.example.priorityqueue;
import java.util.PriorityQueue;
public class PollExample {
public static void main(String... args) {
PriorityQueue<String> pq = new PriorityQueue<>();
pq.offer("one");
pq.offer("two");
System.out.println(pq);
String element = pq.poll();
System.out.println(element);
element = pq.poll();
System.out.println(element);
element = pq.poll();
System.out.println(element);
}
}