(String[] args)
| 10 | public class JDKProxy { |
| 11 | |
| 12 | public static void main(String[] args) { |
| 13 | UserService userService = new UserServiceImpl(); |
| 14 | UserService proxy = (UserService) Proxy.newProxyInstance(userService.getClass().getClassLoader(), |
| 15 | new Class[]{UserService.class}, new Handler(userService)); |
| 16 | proxy.printName(); |
| 17 | } |
| 18 | |
| 19 | } |