Question 12
Back to Exercise
What is an important advantage of immutable objects?
- A They use less memory
- B They can be shared freely, including between threads, because no one can change them after construction Correct
- C They can be modified faster
- D They do not need constructors
Correct Answer: Option B
Modifications create new objects, so existing ones stay valid forever.
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!