package PJH;

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

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

}
package PJH;

public class DemoAB {

    public static void main(String[] args) {
        B b =new B("悟空");
        b.fun();
    }
}