Java tutorial
//package com.java2s; public class Main { private static boolean isAssignableFrom(Class<?> clazz, Class<?> iClazz) { if (iClazz.isAssignableFrom(clazz)) { return true; } else if (clazz.getSuperclass() != null) { if (iClazz.isAssignableFrom(clazz.getSuperclass())) { return true; } else { return isAssignableFrom(clazz.getSuperclass(), iClazz); } } else { return false; } } }