I am having some difficulty in being able to come up with an answer to the following question. I was able to know that it uses Generics and known that it would help it help to remove some run time errors with the type, but am unable to think of answer to write for it.
A Java class is to be used to store the elements of a priority queue, which will be sorted into priority order. The header of this class is:
public class PriorityQueue<T extends Comparable<T>>
Explain the significance of <T extends Comparable<T>>
both for code in the implementation of Priority Queue, and for client code that creates an instance of Priority Queue.