Why in this situation ReferenceEquals method of object behaves differently?
string a= "fg";
string b= "fg";
Console.WriteLine(object.ReferenceEquals(a, b));
So in this situation it's get a result true. In case, it compares values of my strings and not references. But when I write something like:
StringBuilder c = new StringBuilder("fg");
string d = c.ToString();
Console.WriteLine(object.ReferenceEquals(a, d));
In this case it works fine and result is false, because it compares references of my objects.
 
     
     
     
     
     
     
    