I just saw code similar to this:
public class Scratch { public static void main(String[] args) { Integer a = 1000, b = 1000; System.o
In Java the boxing works in the range between -128 and 127 for an Integer. When you are using numbers in this range you can compare it with the == operator. For Integer objects outside the range you have to use equals.