3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Momerath
0

The types are immutable, meaning you can't change their value. 3 = 3 no matter what you want it to be. The variable i in your example isn't immutable, it can be any Int32 value. But as was said, the value itself cannot be changed.

And as was said in the link, generally you use a struct to represent an immutable object. The .Net framework follows this 'rule' (DateTime for example). Methods on the struct return a new struct, they don't modify the one you have.

Edited by Momerath: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.