我在java
以下分级来我interface
在斯卡拉
public interface Identifiable<T extends Comparable<T>> extends Serializable {
public T getId();
}
public interface Function extends Identifiable {
public String getId();
}
public abstract class Adapter implements Function {
public abstract String getId();
}
当我尝试在scala
实现Adapter
如下
class MultiGetFunction extends Adapter {
def getId() : String = this.getClass.getName
}
我收到以下错误
实现多级的Java接口Multiple markers at this line
- overriding method getId in trait Identifiable of type()T; method getId has incompatible
type
- overrides Adapter.getId
- implements Function.getId
- implements Identifiable.getId
http://stackoverflow.com/q/5279149/1296806其中包括一个经典的paulp回应。 –