示例#1
0
        private static void TestReferenceEquals()
        {
            Ch7 x, y;

            x = new Ch7();
            y = new Ch7();

            bool B1 = ReferenceEquals(null, null); // returns true
            bool B2 = ReferenceEquals(null, x);    // returns false
            bool B3 = ReferenceEquals(x, y);       // returns false because x and y point to different objects
        }
示例#2
0
        private static void TestReferenceEquals()
        {
            Ch7 x, y;
            x = new Ch7();
            y = new Ch7();

            bool B1 = ReferenceEquals(null, null); // returns true
            bool B2 = ReferenceEquals(null, x); // returns false
            bool B3 = ReferenceEquals(x, y); // returns false because x and y point to different objects
        }