I came across a very weird behavior which later found to be a part of java specs. Let me put the relevant code from the said posting
Integer a = 1000, b = 1000;
System.out.println(a == b); //Prints false
Integer c = 100, d = 100;
System.out.println(c == d); //Prints true
This quite similar to the String literal pool but with an exception that there is a limit to it. Let me quote again from Jon Skeet's reply to earlier mentioned post.
If the value p being boxed is true, false, a byte, a char in the range \u0000 to \u007f, or an int or short number between -128 and 127, then let r1 and r2 be the results of any two boxing conversions of p. It is always the case that r1 == r2.
Now my questions is, since we do not have a limit to the String Literal Pool, why not the same for other types ? What were the design/performance considerations for not having this? Is there any way its configurable?