Java tutorial
public class Main { public static void main(final String[] args) { Class cls = new Integer("0").getClass(); cls.isInstance(new Double("1.2").getClass()); Number.class.isInstance(123); cls = Number.class; cls.isAssignableFrom(new Double("1.2").getClass()); } }