反射访问类的成员变量之方法
Class<?> bossCls = Class.forName("com.hspedu.reflection.Boss");
Object o = bossCls.newInstance();
Method hi = bossCls.getDeclaredMethod("hi", String.class);
hi.invoke(o, "韩顺平教育~");
Method say = bossCls.getDeclaredMethod("say", int.class, String.class, char.class);
say.setAccessible(true);
System.out.println(say.invoke(o, 100, "张三", '男'));
System.out.println(say.invoke(null, 200, "李四", '女'));
Object reVal = say.invoke(null, 300, "王五", '男');
System.out.println("reVal 的运行类型=" + reVal.getClass());
Method m1 = bossCls.getDeclaredMethod("m1");
Object reVal2 = m1.invoke(o);
System.out.println("reVal2的运行类型=" + reVal2.getClass());