package testDesignPattern;
public class AdapterDemo {
public static void main(String[] args) {
//代理模式
CpuAdapter cpuAdapter = new CpuAdapter();
cpuAdapter.work();
}
}
interface ICpu{
void work();
}
class Cpu{
public void CpuImp() {
System.out.println("CpuImp");
}
}
//代理模式
class CpuAdapter extends Cpu implements ICpu{
@Override
public void work() {
super.CpuImp();
}
}