Get the class By way of an object : Object « Reflection « Java
- Java
- Reflection
- Object
Get the class By way of an object
public class Main {
public static void main(String[] argv) throws Exception {
Object object = new String();
// By way of an object
Class cls = object.getClass();
}
}
Related examples in the same category