接口的多继承

mac2024-01-23  34

package zuoye; /**  *    接口的多继承  *    java中类没有多继承,但是接口有多继承  * @author 110  *  */ public class pravtice12 {     public static void main(String[] args) {              } } interface A{     void testa(); } interface B{     void testb(); } /*接口可以多继承:接口C继承接口A和B*/ interface C extends A,B{     void testc(); } class Test implements C{     public void testc(){         System.out.println("a");     }     public void testb(){         System.out.println("b");     }     public void testa(){         System.out.println("c");     } }

最新回复(0)