public class Test {
public void setParam(N... n) { System.out.println("Calling set param...");}public static void main(String[] args) throws Exception { Test t=new Test(); Class<?> c = Class.forName("test.Test"); Method method = c.getMethod ("setParam", N[].class); method.invoke(t, (Object) new N[]{});}}为我工作。
- 将您的N []投射到对象
- 在实例上调用,而不在类上调用



