Java, Programming Languages, Programming, Object Oriented.
public Number getAgeAsNumber() { return age; } This method will return the age of an animal not as an integer but as a Number. This method can be overridden like this: @Override public Integer getAgeAsNumber() { return super.getAgeAsNumber().intValue(); } This is called covariant return, and it