打印超类
//package com.nowjava; /* N o w J a v a . c o m - 时 代 Java 提 供 */ import static java.lang.System.out; public class Main { public static void printSuperclass(Class<?> c) { Class<?> superClass = c.getSuperclass(); if (null != superClass) { out.format("Superclass => %s", superClass.getName()); } else { out.format("Superclass => No superclass"); } out.format("%n%n"); } }