I have already created a class called priority queue.
public class PriorityQueue<T> implements Iterable<T>
And now, I want to create a class SpecialPriorityQueue<T> with these details.
- While T in PriorityQueue can be any type, T in SpecialPriorityQueue has to implement an interface.
- SpecialPriorityQueue inherits from PriorityQueue, and it override some methods and uses some protected field of the PriorityQueue.
Is there any clean way to do this without changing the code of PriorityQueue?