Package com. Lean. SSM. Chapter2. Reflect;//package name
Public class ReflectServicelmp//class name
{
Public void sayHello (String name) method to construct the sayHello
{
System. Err. Println (" Hello "+ name); Err what do you mean????????????????????????????????????????????????????????
}
}
Public ReflectServiceimpl getinstance () {getinstance () here? What is the meaning of???
ReflectServiceimpl ob] ect=null; The meaning of this sentence
Try {
The object=(ReflectServiceimpl) the meaning of this sentence
Class.forname (" com.com. Lean. SSM. Chapter2. Reflect. ReflectServicelmp "). The newInstance ();//the meaning of this sentence
} the catch (a ClassNotFoundException | InstantiationException | I
the meaning of this sentenceLegalAccessException ex. PrintStackTrace (); What is the meaning of here???????
}
The return object; What is the meaning of here???????
}
CodePudding user response:
Through reflection to obtain a class object to returnCodePudding user response:
This isn't just know probably mean?????