Java examples for Reflection:Class
get Class Super Class
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { Class classInstance = String.class; getClassSuperClass(classInstance); }//www .j a va 2s .c o m public static void getClassSuperClass(Class<?> classInstance) { Class supClass = classInstance.getSuperclass(); if (supClass != null) //super class System.out.print(" extends " + supClass.getName()); } }