11.13 第十一次、

package GJS;

public abstract class GJS {
    private String name;
    public GJS(String name) {
        this.name=name;
    }
    public String getName() {
        return this.name;
    }
    public abstract void fun();
}
package GJS;

public class GJS1 extends GJS {
    public GJS1(String name) {
        super(name);
    }
    public void fun() {
        System.out.println(super.getName());
    }

}
package GJS;

public class DemoAB {

    public static void main(String[] args) {
        GJS1 b =new GJS1("XXXXXX");
        b.fun();
    }
}

 

posted @ 2017-11-19 22:52  FM10086  阅读(74)  评论(0编辑  收藏  举报