// https://stackoverflow.com/questions/20897020/why-integer-class-caching-values-in-the-range-128-to-127 public class Cache { public static void main(String[] args) { Integer i, j; for (i = -200; i <= 200; i++) { j = i + 0; System.out.println(i + " " + i.equals(j) + " " + (i == j)); } } }