I have the following lines of code in Java:
public class myProjects {
public static void main(String[] args) {
// TODO Auto-generated method stub
Integer d = Integer.MAX_VALUE;
Integer e = Integer.MAX_VALUE;
System.out.println(d);
System.out.println(e);
if(d == e){
System.out.println("They are equal\n");
}else {
System.out.println("They are not equal\n");
}
}
}
Output:
2147483647
2147483647
They are not equal
Why are they not equal even though they have the same value?