Your GenericQueue
is implementing the raw interface IGenericQueue
, so its T
is different than the T
in IGenericQueue
. Add the <T>
in the implements
clause:
public class GenericQueue<T extends Comparable> implements IGenericQueue<T> {
// ^^^
so you are implementing the generic interface with the same T
.