本帖最后由 陈德基 于 2012-10-2 11:30 编辑
- Collection cll = (Collection) Proxy.newProxyInstance(Collection.class.getClassLoader(),
- new Class[]{Collection.class},
- new InvocationHandler(){
- ArrayList list = new ArrayList();
- public Object invoke(Object proxy, Method method,
- Object[] args) throws Throwable {
- return method.invoke(list, args);
- }
- });
- System.out.println(cll.size());
复制代码 问题就是,InvocationHandler的匿名子类对象里的详细过程是什么样的?望高人指点 |