2

I would like to implement another interface in this interface (Ifirst). Problem is very big because they are blocked and is not possible to write "implements Isecond" Maybe you know what I have to do to implement this in another way? Because this problem is very hard of course look easy but is really difficult.

public interface Ifirst {

}

public interface Isecond {

}

They are blocked and I can use them but I`am not able to edit.

I get answ - > Create a third that extends first and second and don't add anything to it

I get correct answer, maybe is not the best way but is working. I gave you points for help Topic [closed] "Create a third that extends first and second and don't add anything to it."

4

2 回答 2

3

Are you asking how to extend an interface?

 public interface Iseond extends Ifirst {

 }

Interfaces extend other interfaces.

类扩展其他类并实现接口。

于 2012-11-01T10:16:32.020 回答
1

接口不能使用implements,规则是:

  • 一个接口extends其他接口。
  • 一个类implements其他接口。
  • 一个类extends另一个非final类。

如果你不能修改Ifirstand Isecond,那就是这样。

public interface Ithird extends Ifirst, Isecond {

}
于 2012-11-01T10:41:22.337 回答