Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Boxing Query  RSS feed

 
narain ashwin
Ranch Hand
Posts: 49
  • 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: 9610
37
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...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!