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;
}
会当凌绝顶,一览众山小