wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Boxing Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Boxing Query" Watch "Boxing Query" New topic
Author

Boxing Query

narain ashwin
Ranch Hand

Joined: Dec 27, 2007
Posts: 48
Hi,
Was working out boxing concepts from KB book @ page 245, found something strange


it seems upto 127 ( to be precise in the byte range i.e -128 to 127 ) JVM uses the same object for subsequent assignments, whereas from 128 it creates different objects. Any generalization explanation?

I drink two cappuccinos a day.Is that of any help to solve java problems??
JBoss 6 - Admin console Username/pwd: admin/admin
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

There have been discussions in the past about this like here and here...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Boxing Query
 
Similar Threads
Integer Class
Strange Behaviour Of Wrapper Class
Strange Behaviour Of Wrapper Class
Integer unboxing and == operator question
Need help for Autboxing..