- #1
tmt1
- 234
- 0
In java, 2 Integer objects with the same value share the same address if their values fit into the range of an unsigned byte.
My question is, why just Integers that fit into this range?
Wouldn't the jvm be optimized if all Integers shared the same address if they had the same value?
Thanks
My question is, why just Integers that fit into this range?
Wouldn't the jvm be optimized if all Integers shared the same address if they had the same value?
Thanks