Is there any reason to use Integer.valueOf(X) to initialize a final Integer, as below:
public class MyClass
{
public static final Integer DAY_1 = Integer.valueOf(1); // Why do it this way?
public static final Integer DAY_2 = 2; // When it can be done this way?
}
I understand this was necessary in older versions of Java before autoboxing was added. Does any reason for this type of code remain? Or is it just a bad habit?