Question: How do you change the value of an instance variable in an immutable class? A. Call the setter method. B. Remove the final modifier and
How do you change the value of an instance variable in an immutable class?
A. Call the setter method.
B. Remove the final modifier and set the instance variable directly.
C. Create a new instance with an inner class.
D. Use a method other than Option A, B, or C.
E. You can’t.
Step by Step Solution
3.35 Rating (155 Votes )
There are 3 Steps involved in it
The correct answer is E You cant An immutable object is an object whose state cannot be changed once ... View full answer
Get step-by-step solutions from verified subject matter experts
