Java tutorial
public class Main { public static void main(String[] args) throws Exception { Main cls = new Main(); Class c = cls.getClass(); Class bClass = BaseClass.class; boolean retval = bClass.isAssignableFrom(c); System.out.println("Return Value = " + retval); retval = c.isAssignableFrom(bClass); System.out.println("Return Value = " + retval); } } class BaseClass extends Main { public BaseClass() { } }