java Class.getSimpleName of
- 2020-06-07 04:27:07
- OfStack
java Class.getSimpleName(
Usage in android:
private static final String TAG = DemoApplication.class.getSimpleName();
Example code:
public class sample{
public static void main(String[] args){
// Gets the short name of the class
System.out.println(sample.class.getSimpleName());
// Gets the full path of the object
System.out.println(sample.class);
// Get an example of the class template for the object, i.e Class
System.out.println(sample.class.getClass());
// get Class The name of the class
System.out.println(sample.class.getClass().getName());
}
}
The print result is:
sample
class com.lovo.test.sample
class java.lang.Class
java.lang.Class
Thank you for reading, I hope to help you, thank you for your support to this site!