Getting the Superclass of an Object : SuperClass « Reflection « Java
- Java
- Reflection
- SuperClass
Getting the Superclass of an Object
public class Main {
public static void main(String[] argv) throws Exception {
Object o = new String();
Class sup = o.getClass().getSuperclass(); // java.lang.Object
}
}
Related examples in the same category