public abstract class BankTest {
public static void main(String[] args) {
DrawMoney drawMoney = new DrawMoney();
drawMoney.dothing();
ManagerMoney managerMoney = new ManagerMoney();
managerMoney.dothing();
}
public void havaNumber(){
System.out.println("取号办理业务");
}
public abstract void transact();
public void talk(){
System.out.println("给刚才的服务打个分\n");
}
public final void dothing(){
havaNumber();
transact();
talk();
}
}
class DrawMoney extends BankTest{
@Override
public void transact() {
System.out.println("我要存款");
}
}
class ManagerMoney extends BankTest{
@Override
public void transact() {
System.out.println("我要理财");
}
}