Java tutorial
public class Main { public static void main(String[] args) { Class cls = Long.class; Long l = new Long(8); Double d = new Double(3.5); // checking for Long instance boolean retval = cls.isInstance(l); System.out.println(l + " is Long ? " + retval); // checking for Long instance retval = cls.isInstance(d); System.out.println(d + " is Long ? " + retval); } }