I was just looking at the source code for the Integer class and I came across these lines:
public static final int MAX_VALUE = Integer.MAX_VALUE;
public static final int MIN_VALUE = Integer.MIN_VALUE;
These are the only places where MAX_VALUE or MIN_VALUE is declared in the Integer class, so it seems that the values are assigned to themselves...
But when I try to print the values, I get:
2147483647 -> 0x7fffffff
-2147483648 -> 0x80000000
So it still produces the correct value, but where is it assigned? I am using the latest java (8) on eclipse
I couldn't find the code online, so I will just paste the relevant code here:
package java.lang;
import sun.misc.VM;
public final class Integer
extends Number
implements Comparable<Integer>
{
public static final int MIN_VALUE = Integer.MIN_VALUE;
public static final int MAX_VALUE = Integer.MAX_VALUE;
...
}
After solving this, it seems that eclipse modifies the source code for some jar files. Best way to view