接口的多继承

  接口完全支持多继承。和类的继承类似,子接口扩展某个父接口,将会获得父接口中所定义的一切。

【示例】接口的多继承

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
interface A {
    void testa();
}
interface B {
    void testb();
}
/**接口可以多继承:接口C继承接口A和B*/
interface extends A, B {
    void testc();
}
public class Test implements C {
    public void testc() {
    }
    public void testa() {
    }
    public void testb() {
    }
}
原文地址:https://www.cnblogs.com/huaxiansheng/p/15312808.html