目录

Java泛型 - 没有重载( 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) { }
}
↑回到顶部↑
WIKI教程 @2018