public class ReflectTest {
public static void main(String[] args) throws Exception {
String m1 =args[0];
Method m = Class.forName(m1).getMethod("main", String[].class);
m.invoke(null, (Object)new String[]{"111","222","333"});
}
}
class Test{
public static void main(String[] args) {
for(String s:args){
System.out.println(s);
}
}
}
这个程序为什么会报出错误?求详细解释,视屏没看太明白
|
|