ArrayList<String> target = new ArrayList<String>();
public Object invoke(Object proxy, Method method,
Object[] args) throws Throwable
{
Object retVal = method.invoke(target, args);
return retVal;
}
}
);
proxy.add("nihao");
proxy.add("it.cast");
proxy.add("wolaile");
System.out.println(proxy);
<font color="#ff0000"> Iterator it = proxy.iterator();</font>
while(it.hasNext())
{
System.out.println(it.next());
}
}
}
复制代码
错误提示:Exception in thread "main" java.lang.Error: Unresolved compilation problem: Type mismatch: cannot convert from Iterator to CompactShortArray.Iterator
at w2014091801.w20140918proxy.main(w20140918proxy.java:41)