C# == 和 Equals 区别
class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); var s1 = new string("yyy"); var s2 = new string("yyy"); var s3 = new StringBuilder("yyy"); var s4 = new StringBuilder("yyy"); Console.WriteLine("object.ReferenceEquals(s1, s2): " + object.Equals(s1, s2)); Console.WriteLine("object.ReferenceEquals(s3, s4): " + object.Equals(s3, s4)); Console.WriteLine("s1 == s2: " + (s1.GetHashCode() + " " + s2.GetHashCode())); Console.WriteLine("s1 == s2: " + (s1.GetHashCode() + " " + s2.GetHashCode()) + " " + s1.Equals(s2)); Console.WriteLine("s3 == s4: " + (s3.GetHashCode()