Hello Mark,
Guys correct me if im wrong.
Looking at the <Generic Type> in the interface definition,
interface Carnivore<E extends Animal> extends Hungry<E> {}
E is restricted to any type that is Either an Animal class itself or Subclasses of Animal.
Now since sheep extends Plant,
class Sheep extends Plant implements Carnivore<Wolf> {
public void munch(Wolf x) {}
}
replacing E with Sheep causes a compiler error because sheep is not an Animal anymore, its a Plant
.
Hope that helped.
Kind Regards.
Hasnain Javed Khan.