- ArrayList listproxy= (ArrayList) constructor.newInstance(new InvocationHandler(){
- @Override
- public Object invoke(Object proxy, Method method,
- Object[] args) throws Throwable {
- // TODO Auto-generated method stub
- long starttime = System.currentTimeMillis();
- Object revalue = method.invoke(target, args);
- long endtime = System.currentTimeMillis();
- System.out.println("方法:" + method.getName() + "一共用时"
- + (endtime - starttime));
- return revalue;
- }
- });
复制代码 为什么老是报告类型转换异常啊,把ArrayList换成Collection就能正常执行呢
|