不积跬步,无以至千里

博客园 首页 新随笔 联系 订阅 管理

//反射类main()方法:public static void main(String[] args)
    @Test
    public void test3() throws Exception{
        Class clazz = Class.forName("telecom.xinj.test01.Person");
        Method method = clazz.getMethod("main", String[].class);

   //方法1
        //method.invoke(null,new Object[]{new String[]{"1","2","3"}}); 

    //方法2
        method.invoke(null,(Object)new String[]{"1","2","3"});
    }

posted on 2016-01-21 19:44  Zeroassetsor  阅读(378)  评论(0)    收藏  举报