一个类不允许具有两个在类型擦除后可以具有相同签名的重载方法。
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) { } }
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)