【发布时间】:2012-08-13 12:01:44
【问题描述】:
我有超类 Foo。还有一个类 Bar 扩展它。
public class Bar extends Foo
Foo 中的函数:
protected void saveAll(Collection<?> many)
Bar 中的功能:
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.
我做错了什么?
【问题讨论】:
-
我冒昧地删除了“休眠”标签,因为它似乎与问题无关。