Immutable objects
What’s the difference between System.String and System.Text.StringBuilder classes?
What’s the advantage of using System.Text.StringBuilder over System.String?
Why is immutability important in programming?
e.g. If another thread invokes color.set after Statement 1 but before Statement 2, the value of myColorInt won’t match the value of myColorName
int myColorInt = color.getRGB(); //Statement 1
String myColorName = color.getName(); //Statement 2
How can you create an immutable class in C#?
What is the readonly keyword in C#?
What are the advantages of using immutable objects in multi-threaded applications?
What are the potential downsides of using immutable objects?
How can you achieve immutability for collections in C#?
What is object pooling, and how does it relate to immutability?
Can you explain the difference between value types and reference types in the context of immutability?
Immutable data types
Mutable data types