invoke(new int[])运行时会不会把里面的数组拆开
public static void test1() throws Exception{Class clazz = Class.forName("javaWeb.Person");
Method method = clazz.getMethod("main", String [].class);
method.invoke(null,(Object)new String[] {"aa","bb"});
}
public static void test2() throws Exception{
Class clazz = Class.forName("javaWeb.Person");
Method method = clazz.getMethod("run", int [].class);
method.invoke(null,new int[] {1,5});
}
上面两个函数中的invoke方法为什么new String[]前面要加一个(Object),而new int[]前面不用啊??