why when passing to the method List<Animal> instead of ArrayList<Animal> it cause a complair error
The method checkAnimals(ArrayList<Animal>) in the type AnimalDoctorGeneric is not applicable for the arguments (List<Animal>)
although we can say List<Animal> a= new ArrayList<Animal>(); when declaring it.
Because while all ArrayList<Animal> IS-A List<Animal> is true, which is why the assignment is legal, not all List<Animal> IS-A ArrayList<Animal>, which is why the method call is not legal.
Henry