我有超类Foo。还有一个类 Bar 扩展它。
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.
我究竟做错了什么?