Here is the code:
public class Test {
private static void print(List<Plant> plants) {
}
private static void print(List<Animal> animals) {
}
}
class Animal {
}
class Plant {
}
When I want to overload print
method in Test class for Animal and Plant lists, the compiler says that "both methods have same erasure". When I research "method erasure", I could not relate it to my situation.