*
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
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: 9293
    
  17

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


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
 
subject: Boxing Query