鉴于:
object literal1 = "abc";
object literal2 = "abc";
object copiedVariable = string.Copy((string)literal1);
if (literal1 == literal2)
Console.WriteLine("objects are equal because of interning");//Are equal
if(literal1 == copiedVariable)
Console.WriteLine("copy is equal");
else
Console.WriteLine("copy not eq");//NOT equal
这些结果意味着copiedVariable
不受字符串实习的影响。为什么?
在这种情况下,有没有被实习的等效字符串是有用的,或者这种行为是由于某些语言细节造成的?