Suppose I have the following generic classes;
Queue<T>
KellysCoffee
CheckOut
and the following generic interfaces
QueueInterface
OrderLineInterface
Suppose I want KellysCoffee
to extend Queue class and implement OrderLineInterface
This is how I've done it
private class KellyCoffee<Order extends Queue<Order>> implements OrderLineInterface{}
Now when I try to implement CheckOut
public class CheckOut<Order> extends KellysCoffee<Order>{}
I get a bound mismatch error saying
The type Order is not a vlaid substitute for the bounded parameter <Order extends Queue<Order>> of the type KellysOrder<Order>
when I try to extend KellyCoffee
Is there a way to fix this?