1
2//package com.java2s;
3
4import static java.lang.System.out;
5
6public class Main {
7 public static void printInheritanceTree(Class<?> c) {
8 out.format("Inheritance Tree => %n");
9 Class<?> ancestor = c.getSuperclass();
10
11 while (ancestor != null) {
12 out.format(" %s%n", ancestor.getCanonicalName());
13 ancestor = ancestor.getSuperclass();
14 }// w w w . ja v a 2s.co m
15 out.format("%n%n");
16 }
17}
18