Java Generics 简明教程

Java Generics - No Overload

不允许类在类型擦除后具有两个具有相同签名的重载方法。

class Box  {
   //Compiler error
   //Erasure of method print(List<String>)
   //is the same as another method in type Box
   public void print(List<String> stringList) { }
   public void print(List<Integer> integerList) { }
}