SSM学习笔记(3)

1、实例:

 

解决:

public Object reflect(){
   ReflectServiceImpl object = null;
try{
object = (ReflectServiceImpl)
Class.forname("com.lean.ssm.reflect.ReflectServiceImpl").newInstance();

Methode method = object.getClass().getMethod("sayHello",String.class);
method.invoke(object,"张三");
}catch(Exception e){
e.printStackTrace();
}
return object;
}
posted @ 2020-04-29 20:46  赚钱买个打印机  阅读(152)  评论(0编辑  收藏  举报