What class parameter type should should be passed for variable arg Object array
If I have to pass an Object... var arguments parameter as input 开发者_高级运维to the Method.invoke call, what should I specify as the parameter type for the Class.getMethod call
Class.getMethod("methodName", Object[].class)
UPDATE How to work with varargs and reflection provides more precise answer by Bozho
You're best off if you can specify the Classes that represent the real formal parameters of the method, as in its declaration. If you can't, the rules for resolution (at the link you provide) are not the most transparent.
精彩评论