"Number boxing" problem in Kotlin Pitfall

Reprinted from: [Kotlin] "Digital boxing" problem in Kotlin Pit_Blog in white robe-CSDN blog_kotlin digital boxing

Key point: The JVM has cached all int numbers in [-128,127]. Any object pointing to this range cannot be "created" separately, so there is no need to talk about "boxing".

Guess you like

Origin blog.csdn.net/lichun85/article/details/123167406