package 习题;
import java.lang.reflect.Method;
public class MainFanShe {
public static void main(String[] args) throws Exception {
String startingClassName = args[0];
Method methodMain = startingClassName.getClass().getDeclaredMethod(
"main", String[].class);
methodMain.invoke(null, new Object[] { new String[] {"aa", "ss", "vv" }});
}
}
class MainDemo {
public static void main(String[] args) {
for (String s : args)
System.out.println(s);
}
};
打印结果是习题.MainDemo
而为什么不是 aa ss ww |