Ankit Garg wrote:Payel please start a new topic for your problem by clicking .
Also when you post the code in the new topic, please Use Code Tags...
The topic was a continuation of the same query so does not need to be included as a separate topic/ new topic.
Regarding code tag will keep that in mind in the next post, for sure.
BTW can you/ anyone else provide the explanation, thanks
The below syntax is only creates a new wrapper object on the Integer Literal Pool. If the value within -128 to 127, they will be referred by two reference variable, but actually, there will be only one object.
Others will create objects on the heap as like any 'Other' objects.
So the == method, since it check the bit patterns of the object reference, will give the output like above....
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Joined: Jan 28, 2010
Thank you Tim and Abimaran for your prompt responses. Highly appreciate your explanations.
subject: Integer unboxing and == operator question