我很难想到这个标题,所以请原谅我.
我有一个使用以下方法的接口:
public interface Algorithm{ public Set extends Algorithm > map(int numPartitions); public F reduce(Set extends Algorithm > partitions); }
以及Algorithm
使用以下方法实现的类:
public class LinearSearchimplements Algorithm , Integer> { @Override public Set
> map(int numPartitions) { return null; } @Override public Integer reduce(Set > partitions) { return null; } }
现在奇怪的是Eclipse正在抱怨第二种方法,reduce
.
The method reduce(Set
>) of type LinearSearch must override or implement a supertype method.
尽管map
方法很好,但这是事实.那我哪里错了?