java07接口与继承动手动脑

1.源代码:

package Work;

 

class A{

public A(){

System.out.println("Class A.");

}

public A(String string){

System.out.println("Class A."+string);

}}

class B extends A{

public B(){

super("string ");

System.out.print("Class B.");

}

}

public class Test01 extends B {

public static void main(String[] args) {

         B b=new B();

}

}

运行:

 

posted @ 2016-12-20 21:15  陶雨洁  阅读(97)  评论(0编辑  收藏  举报