Exemplo n.º 1
0
        static void Main(string[] args)
        {
            MyComplexClass myObj = new MyComplexClass();

            WriteLine(myObj.ToString());
            ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            MyComplexClass myObj = new MyComplexClass();

            WriteLine(myObj.ToString());//ToString 将对象的类名以字符串形式返回
            ReadKey();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            MyComplexClass myObj = new MyComplexClass();

            WriteLine(myObj.ToString());
            Program x = new Program();

            WriteLine(x.ToString());
            WriteLine(myObj.GetType());
            WriteLine(typeof(MyComplexClass));
            ReadKey();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            MyComplexClass myObj = new MyComplexClass();

            WriteLine(myObj.ToString());
            WriteLine(myObj.GetHashCode());
            WriteLine(myObj.GetType());
            WriteLine(myObj.Equals(new object()));
            WriteLine(object.Equals(myObj, new object()));
            WriteLine(object.ReferenceEquals(myObj, myObj));
            MyComplexClass myObj2 = myObj.ShallowCopy();

            WriteLine(myObj2.ToString());
            WriteLine(myObj2.GetHashCode());
            WriteLine(object.ReferenceEquals(myObj, myObj2));
            WriteLine(myObj.Equals(myObj2));
            ReadKey();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            MyComplexClass myObj = new MyComplexClass();

            Console.WriteLine(myObj.ToString());
        }