首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

透过反射执行某类的方法

2013-08-23 
通过反射执行某类的方法LotteryManager lmnew LotteryManager()Method methodLotteryManager.class.get

通过反射执行某类的方法
LotteryManager lm=new LotteryManager();Method method=LotteryManager.class.getMethod(methodName,String.class);method.invoke(lm,"Jhone");

?

?

?

?

热点排行