本帖最后由 啸傲江湖007 于 2012-7-7 22:13 编辑
Collection proxy3 =(Collection) Proxy.newProxyInstance(
Collection.class.getClassLoader(),
new Class [] {Collection.class},
new InvocationHandler(){
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
//怎么理解target
ArrayList target = new ArrayList();
long beginTime = System.currentTimeMillis();
Object retVal = method.invoke(target, args);
long endTime = System.currentTimeMillis();
System.out.println(method.getName()+" running time " +(endTime-beginTime));
return retVal;
}
}
);
定义的 ArrayList target = new ArrayList();
应该怎么理解?
|
|