package zhu;
public class test1006 {
public static void main(String[] args) {
UserManager um=new UserManager();
um.action("admin","add");
}
}
abstract class BaseManager{
public void action(String name,String method) {
if("admin".equals(name)) {
execute(method);
}else {
System.out.println("你没有操作操作,请联系管理员");
}
}
public abstract void execute(String method);
}
class UserManager extends BaseManager{
public void execute(String method) {
if("add".equals(method)) {
System.out.println("add");
}else if("del".equals(method)) {
System.out.println("delete");
}
}
}