Type an @Override method with a covariant return
Type an @Override method with a covariant return
Answer
@Override Dog getAnimal() { return new Dog("Rex", 3); }
Covariant return: if the parent declares Animal getAnimal(), overriding with Dog getAnimal() is valid because Dog IS-A Animal. @Override confirms the compiler checks the relationship.