Nikhil Kumar C wrote:
Is there any specific reason why only integer values between -128 to 127 are being cached?
The specification defines the types and the ranges that must be cached. It does not define what should happen to the values of other types, or if they are outside of the required ranges.
The current Sun
java implementation caches as required, plus... (1) it also caches long values, which is not required, and (2) there is a switch to allow the user to increase the range (caching values which are not required).
Henry