Get unqualified class Name
public class Main{
public static void main(String[] argv) {
String o = "";
Class clazz = o.getClass();
String name = clazz.getName();
System.out.println(name.substring(name.lastIndexOf('.') + 1));
}
}
Home
Java Book
Runnable examples
Java Book
Runnable examples
Reflection Class:
- Class modifier: public, abstract or final
- Class simple name plus package name
- Create new instance
- Class reflection, all methods, constructors, parameters, interfaces
- Get super class name
- Get the class By way of .class
- Get unqualified class Name
- Is Type Compatible
- Is Primitive type
- Load a class given its name.