Java tutorial
//package com.java2s; public class Main { public static boolean isSubclassOf(Class<?> type, Class<?> superClass) { if (type.getSuperclass() != null) { if (type.getSuperclass().equals(superClass)) { return true; } return isSubclassOf(type.getSuperclass(), superClass); } return false; } }