public abstract class Temple {
public void one() {
System.out.println("one");
}
public abstract void two();
public void three() {
System.out.println("three");
}
public void four() {
System.out.println("four");
}
public final void begin() {
one();
two();
three();
four();
}
}
public class Concrete extends Temple {
@Override
public void two() {
System.out.println("concrete two方法");
}
}
测试
public class Test {
public static void main(String[] args) {
new Concrete().begin();
}
}
网友评论