List<A> list = new List<A>();
A a = new A();
A.name = "name1";
list.Add(a);
a = new A();
a.name = "name2";
list.Add(a);
Will the list finally contains the two same A with name equals to “name2”?
How to make use of one variable to achieve this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The list will contain two different instances of Type A; one with a name set to “name1”, the other set to “name2”.