动态代理的步骤

1、创建一个实现接口InvocationHandler的类,它必须实现invoke的方法

2.创建被代理的类以及接口

3、通过Proxy的静态方法newProxyInstance(ClassLoader loder,Class[] interface ,InvocationHandler h)创建一个代理

4、通过代理调用方法

原文地址:https://www.cnblogs.com/feifeihu/p/2646496.html