难道这又是传说的新特性造成的吗???????
public class test_11 {
public static void main(String[] args) throws NoSuchMethodException, SecurityException, ClassNotFoundException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
String str=args[0];
Method me=Class.forName(str).getMethod("main",String[].class);
me.invoke(null,(Object)new String[]{"wo","ai","zhonghua"});
}
}
class MyMain
{
public static void main(String[] args)
{
for(String ss:args)
{
System.out.println(ss);
}
}
}
这个里面的me.invoke(null,(Object)new String[]{"wo","ai","zhonghua"});这一句为什么不能强制转换为String呢???
大神在哪里 |
|