Question OOP-ENC-0016
HardWhy do immutable classes (such as Java's String) improve encapsulation?
- A.
They are faster to compile
- B.
Their state can't change after creation, so they can be shared safely without defensive copies
- C.
Sign up free to see the answer and a step-by-step explanation.