📅  最后修改于: 2022-03-11 14:52:09.814000             🧑  作者: Mango
//package com.java2s;
import static java.lang.System.out;
public class Main {
public static void printInheritanceTree(Class> c) {
out.format("Inheritance Tree => %n");
Class> ancestor = c.getSuperclass();
while (ancestor != null) {
out.format(" %s%n", ancestor.getCanonicalName());
ancestor = ancestor.getSuperclass();
}// w w w . ja v a 2s.co m
out.format("%n%n");
}
}