This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
... but the correct answer is true as JVM keeps single object for Integer and Short within the range -128 to 127.
There is no black magic going on here. If you instantiate two objects, you will have two objects. Java doesn't do anything at the compiler or JVM level to magically save object from being instantiated.
This "integer cache" for values "within the range -128 to 127" is implemented by the valueOf() method, which in turn is called by autoboxing. This example uses neither the valueOf() method or autoboxing.