From what I understood from Made one instance of a class equal to another. – How to cancel that?, objects are simply references to memory meaning that if two objects are equal to each other and one change is made to one object, the same change should apply to another object.
However, when I run this code:
Point original = new Point(100, 100);
Point temp = original;
original.X += 100;
Console.WriteLine(original);
Console.WriteLine(temp);
The output of original and temp is different. Am I missing something?
Here is the output:
{X=200,Y=100}
{X=100,Y=100}