为什么红色部分不是Proxy?谁能解释下原理和作用么,不太明白,虽然我知道这么写
Class clazzProxy1 =Proxy.getProxyClass(Collection.class.getClassLoader(), Collection.class);
Constructor constructor = clazzProxy1.getConstructor(InvocationHandler.class);
Collection proxy2 =(Collection)constructor.newInstance(new InvocationHandler(){
@Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
// TODO Auto-generated method stub
return null;
}
}); |
|