Why is PriorityQueue in Java defined as,
PriorityQueue<T>
and not as,
PriorityQueue<T extends Comparable<? super T>
It rather gives a ClassCastException at runtime if do not queue objects of type Comparable. (and if I am not using a custom Comparator).
Why not catch it at compile time?