2

我很惊讶这段代码可以编译,但这是什么意思?

public interface IBar {}
public interface IFoo implements IBar {}
4

1 回答 1

4

它无法编译,因为接口不能implement其他接口但可以extends

public interface IFoo extends IBar {}

您的代码必须导致错误:

1084:语法错误:在实现之前需要左大括号。
于 2013-02-28T10:44:00.340 回答