try {
Class clas1 = Class.forName("com.oppo.jcommon.web.bean.AsyOutStoreCheckBean");
Method method = clas1.getMethod("tt",String.class);
/*初始化该对象*/
Object obj = clas1.getConstructor().newInstance();
//调用该方法
method.invoke(obj, "tt");
//System.out.print(method);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
java反射机制基础
最新推荐文章于 2024-09-29 10:56:46 发布