Beispiel #1
0
        public static void Main_7_7_2()//Main_7_7_2
        {
            Student s1 = new Student("Wang", 22);
            Student s3 = (Student)s1.Clone();

            s3.ShowInfo();
            s3.Name = "Hao";
            s3.Age  = 27;
            s3.ShowInfo();
            s1.ShowInfo();
        }
Beispiel #2
0
        public static void Main()//Main_7_7_1
        {
            //引用类型的浅拷贝
            Student s1 = new Student("Wang", 22);
            //执行浅拷贝,
            Student s2 = s1;

            s2.Age = 27;
            s1.ShowInfo();


            //值类型的深拷贝
            //Int32 i = 100;
            //Int32 j = i;
            //j = 200;
            //Console.WriteLine(i);
        }
Beispiel #3
0
 //Main_7_7_2
 public static void Main_7_7_2()
 {
     Student s1 = new Student("Wang", 22);
     Student s3 = (Student)s1.Clone();
     s3.ShowInfo();
     s3.Name = "Hao";
     s3.Age = 27;
     s3.ShowInfo();
     s1.ShowInfo();
 }
Beispiel #4
0
        //Main_7_7_1
        public static void Main()
        {
            //�������͵�dz����
            Student s1 = new Student("Wang", 22);
            //ִ��dz������
            Student s2 = s1;
            s2.Age = 27;
            s1.ShowInfo();

            //ֵ���͵����
            //Int32 i = 100;
            //Int32 j = i;
            //j = 200;
            //Console.WriteLine(i);
        }