using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespacerand
{classProgram
{classE
{publicint a;
publicint b;
public E(int aa, int bb)
{
a = aa;
b = bb;
}
}
staticvoid Main(string[] args)
{
List<E> l = new List<E>();
E A = new E(1, 2);
l.Add(A);
List<E> ll = new List<E>(l); //!!!!
ll[0].a = 4; //!!!!
Console.WriteLine(l[0].a); //结果为4,而不是原来的1
Console.ReadLine();
}
}
}
staticvoidMain(string[] args)
{
EA = newE(1, 2);
ED = A; //!!!!!D.a = 4; //!!!!!Console.WriteLine(A.a); //结果为4,而不是原来的1Console.ReadLine();
}