Can a normal Class implement multiple interfaces?

后端 未结 8 1063
春和景丽
春和景丽 2021-01-31 01:34

I know that multiple inheritances between Interfaces is possible, e.g.:

public interface C extends A,B {...} //Where A, B and C are Interfaces

8条回答
  •  -上瘾入骨i
    2021-01-31 02:38

    An interface can extend other interfaces. Also an interface cannot implement any other interface. When it comes to a class, it can extend one other class and implement any number of interfaces.

    class A extends B implements C,D{...}
    

提交回复
热议问题