Question 11
Back to Exercise
For which values does Integer.valueOf always return cached objects?
- A 0 to 255
- B −128 to 127 Correct
- C −32768 to 32767
- D All values
Correct Answer: Option B
So == between boxed Integers is unreliable outside that range.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!