Class Abc () {}
Public void AA (T T) {
Print (t.g etClass ());//here no, get the class is not Abc, but by the name of the class, how should do?
}
//call
AA (Abc)
CodePudding user response:
Of course, otherwise reflection can't use thePublic void AA (T T) {
Print (t.g etClass (). The getName ());//don't know what are you trying to get at, get the name of the class by getName
}
CodePudding user response:
Public class Test {
Public static void main (String [] args) {
ClassGateWayClass=GateWay. The class;
The getClassName (gateWayClass);
}
Public static void getClassName (Class clazz) {
System. The out. Println (clazz. GetName ());
}
}