예제 #1
0
        public void RefEquivalenceCheck()
        {
            BoxClass b1 = new BoxClass(1, 2, 3);
            BoxClass b2 = new BoxClass(1, 2, 3);

            if (b1.Equals(b2))
            {
                Console.WriteLine("Equal \nVolume = {0} ", b1.Volume());
            }
            else
            {

                Console.WriteLine("Not Equal \nVolume = {0} ", b1.Volume());
            }
        }
예제 #2
0
        public void CheckReferenceEqual()
        {
            BoxClass b1 = new BoxClass(1, 2, 3);
            BoxClass b2 = new BoxClass(1, 2, 3);

            if (Object.ReferenceEquals(b1,b2))
            {
                Console.WriteLine("Ref Equal \nVolume = {0} ", b1.Volume());
            }
            else
            {

                Console.WriteLine("Ref Not Equal \nVolume = {0} ", b1.Volume());
            }
        }