Immutable Object
An object whose data cannot change after it is created.
What is Immutable Object?
An immutable object cannot change after it is created. To "change" it, you make a new object with the new values. Strings in C#, Java and Python work this way.
public record Point(int X, int Y);
var a = new Point(1, 2);
var b = a with { X = 5 }; // a is unchanged; b is a new Point(5, 2)
Level: Journeyman · More OOP terms at this level
Updated