I have this interface method in the Animal interface:
<T extends Animal> boolean isEqual(T pAnimal);
now I am in trouble with the implementation.
I have two classes Dog and Cat. Both classes extends from Animal.
I want to overwrite the method but with the concrete implementation:
@Override
public boolean isEqual(Dog pDog) {
// do some stuff.
return true;
}
this leads to the compile error
must override or implement a supertype method
How I have to define the interface so that it is not necessary to make a typecast in my concrete implementation class?
Thanks in advance
Stefan