适配器模式
public class IntegerDemo { public static void main(String[] args) { UserDao ud = new UserDaoImp(); ud.add(); } } interface UserDao {// 接口 public abstract void add(); public abstract void delete(); public abstract void update(); public abstract void find(); } abstract class UserAdapter implements UserDao {// 抽象类 public void add() { } public void delete() { } public void update() { } public void find() { } } class UserDaoImp extends UserAdapter {// 实现类 public void add() {// 重写 System.out.println("add"); } }