1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Merge pull request #2101 from Conquers/main

Update proxy.md
This commit is contained in:
Guide 2023-07-31 22:38:06 +08:00 committed by GitHub
commit 62721ec58a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,7 @@ public class DebugInvocationHandler implements InvocationHandler {
public class JdkProxyFactory {
public static Object getProxy(Object target) {
return Proxy.newProxyInstance(
target.getClass().getClassLoader(), // 目标类的类加载
target.getClass().getClassLoader(), // 目标类的类加载
target.getClass().getInterfaces(), // 代理需要实现的接口,可指定多个
new DebugInvocationHandler(target) // 代理对象对应的自定义 InvocationHandler
);