“ExplicitlyInternment” (Problem)
What will the following code display?
1
var x = "AB";
2
var y = new StringBuilder().Append('A').Append('B').ToString();
3
var z = string.Intern(y);
4
Console.WriteLine(x == y);
5
Console.WriteLine(x == z);
6
Console.WriteLine((object)x == (object)y);
7
Console.WriteLine((object)x == (object)z);
Copied!
Solution
Copy link