Question 16
Back to Exercise
What does count++ do when count is an Integer?
- A Changes the Integer object in place
- B Unboxes, adds 1, and boxes a new (or cached) Integer that count now refers to Correct
- C Compile error
- D Throws an exception
Correct Answer: Option B
Wrappers are immutable.
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!