java - Dynamic Proxy - Class Loader parameter when creating a new proxy instance -
i wondering when call newproxyinstance method when creating dynamic proxy instance, classloader argument for?
public static object newproxyinstance(classloader loader, class<?>[] interfaces, invocationhandler h) throws illegalargumentexception many thanks!
p.s. i'm not sure how use code formatting tags correctly.
the documentation newproxyinstance defines use equivalent to:
proxy.getproxyclass(loader, interfaces). getconstructor(new class[] { invocationhandler.class }). newinstance(new object[] { handler }); so, if want bit more detail loader, can @ documentation getproxyclass. basically, serves class loader defines generated proxy class.
Comments
Post a Comment