public class WrapperTest {
public static void main(String[] args) {
Integer i = 100;
Integer j = 100;
if(i == j)
System.out.println("same");
else
System.out.println("not same");
}
}
The above code gives the output of "same" when run, however if we change the value of i and j to 1000 the output changes to "not same". As I'm preparing for SCJP, need to get the concept behind this clear. Can someone explain this behavior.Thanks.