Question 16
Back to Exercise
A class stores price as double and later switches to paise in a long. With proper encapsulation, what changes for callers?
- A Every caller must be rewritten
- B Nothing, if the public methods keep the same signatures and behaviour Correct
- C Callers must recompile with a flag
- D Callers must use reflection
Correct Answer: Option B
Hiding the representation is what makes this change safe.
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!