Java泛型名称冲突,具有相同的擦除
我有超班傅。以及扩展它的类栏。
public class Bar extends Foo
Foo 中的功能:
protected void saveAll(Collection<?> many)
酒吧中的功能:
public void saveAll(Collection<MyClass> stuff) {
super.saveAll(stuff);
}
获取错误 :
Name clash: The method saveAll(Collection<MyClass>) of type Bar has the same erasure as saveAll(Collection<?>) of type Foo but does not override it.
我做错了什么?