public static void Main(string[] args) { MyDate m1 = new MyDate(24, 3, 2001); MyDate m2 = new MyDate(24, 3, 2001); Console.WriteLine(m1.Equals(m2)); //不相等,显示false m1 = new MyOkDate(24, 3, 2001); m2 = new MyOkDate(24, 3, 2001); Console.WriteLine(m1.Equals(m2)); //相等,显示true }