What is Immutability? In Object Oriented Programming (OOP) and Functional Programming(FP) it means an object’s state is immutable, i.e. it can’t be altered. Now this sounds like it’s constant but it’s not. For example strings in C# and Java are immutable. Once you’ve set a string value in a variable then you can’t physically alter the memory that contains the string.
So this piece of C# code will not compile or run because of trying to change one letter in fred. Read more →