-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Clean Code with C#
By :

In C#, setting an object to static does not make it immutable. A static object is one that belongs to the class itself, rather than to any instance of the class. It can be accessed using the class name rather than an instance name, and there is only one instance of it shared among all instances of the class.
The immutability of an object depends on its properties and methods. An immutable object is one whose state cannot be changed after it is created. This means that its properties cannot be modified, and any operations that are performed on it return a new instance of the object rather than modifying the existing instance.
To make an object immutable in C#, you can follow these guidelines: