I was poking around in the codebase I just started working with, and found an interface with the following definitions:
Two questions popped to mind: first, since I know this code postdates 1.1, why not just use Integer.class, Double.class, etc.? Second, why define those symbolic constants at all if we can just use Integer.class, Double.class, etc.?
Code:
public static final Class INTEGER_CLASS = (new Integer(0)).getClass();
public static final Class DOUBLE_CLASS = (new Double(0)).getClass();
// etc.
Two questions popped to mind: first, since I know this code postdates 1.1, why not just use Integer.class, Double.class, etc.? Second, why define those symbolic constants at all if we can just use Integer.class, Double.class, etc.?