Skip to content
luthertan98 edited this page Apr 22, 2021 · 1 revision
Method name Description
PriorityQueue​(Comparator super E> comparator) Creates a PriorityQueue with the default initial capacity and whose elements are ordered according to the specified comparator.
add​(E e) Inserts the specified element into this priority queue.
forEach​(Consumer super E> action) Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.
remove​(Object o) Removes a single instance of the specified element from this queue, if it is present.
toArray() Returns an array containing all of the elements in this queue.