大圣前端面试提高&职业生涯规划课
2022-12-08 13:48 作者:bili_1559000721 | 我要投稿
public static void main(String[] args) {
ServiceProvider serviceProvider = (ServiceProvider) Proxy.newProxyInstance(ProxyPattern.class.getClassLoader(),
// 动态代理
new Class[]{ServiceProvider.class},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
// 动态的,可以灵活的根据业务需求去处理
return null;
}
}
);