This is made clear by trying to compile the following code:
import java.util.Date;
import java.util.List;
public class A<T> {
private T value;
public T get() {
return value;
}
public void checkparam(List<AString> list) {
}
public void checkparam(List<ADate> list) {
}
}
class AString extends A<String> {}
class ADate extends A<Date> {}
which produces the following output from javac:
$ javac A.java
A.java:11: name clash: checkparam(java.util.List<AString>) and checkparam(java.util.List<ADate>) have the same erasure
public void checkparam(List<AString> list) {
^
A.java:15: name clash: checkparam(java.util.List<ADate>) and checkparam(java.util.List<AString>) have the same erasure
public void checkparam(List<ADate> list) {
^
2 errors