LearnFrenzy
Sign in Take a free test

Object Class and Wrapper Classes · Object and Wrapper Classes MCQ · Question 16

Are wrapper objects mutable? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links