Answers

Question and Answer:

  Home  Senior .Net Developer

⟩ Please explain what is immutability, what is it for and how is it codified?

The ability of objects not to change their state, once created, helps improve the maintainability of the code. When a mutable object encapsulates its changes without being explicit in the code, following the flow becomes difficult. The level of difficulty increases in case of multi-threaded applications. To create immutable objects, pass the arguments for their creation in the constructor; make their properties read-only later.

 139 views

More Questions for you: