Animal
public abstract class Animal {
String name;
public Animal(String name) {
this.name = name;
}
}
Lion<
Here you have a List of animals. Usually when you have a list of Objects, all these objects must be able to do the same thing without being casted.
So the best two solutions are :
abstract in Animal)Lion from Deer from the start, and have two different lists.