1 2 3 4 5 |
string a = "aaa"; string b = "aaa"; Console.WriteLine(a == b); // true Console.WriteLine(object.ReferenceEquals(a, b)); // true |
1 2 3 4 5 6 |
string a = "aaa"; string b = "aa"; b += "a"; Console.WriteLine(a == b); // true Console.WriteLine(object.ReferenceEquals(a, b)); // false |