Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Boxing Query

 
narain ashwin
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There have been discussions in the past about this like here and here...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic