mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
jdk动态代理实际使用中,new DebugProxy()代码有误
jdk动态代理实际使用中,new DebugProxy()代码有误
This commit is contained in:
parent
c254fcee0d
commit
218d095a17
@ -261,8 +261,7 @@ public class JdkProxyFactory {
|
||||
**5.实际使用**
|
||||
|
||||
```java
|
||||
DebugProxy debugProxy = new DebugProxy(new SmsServiceImpl());
|
||||
SmsService smsService = debugProxy.getProxy(SmsService.class);
|
||||
SmsService smsService = (SmsService) JdkProxyFactory.getProxy(new SmsServiceImpl());
|
||||
smsService.send("java");
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user