Java Associate — Hard
Key points
- Java caches Integer objects for values between -128 to 127
- a and b point to the same object because they have the same value (127)
- c and d do not point to the same object because c and d have different values (128)
Ready to go further?
Related questions
