110,500
社区成员
发帖
与我相关
我的任务
分享
class Program
{
static void Main(string[] args)
{
Dictionary<A, string> dic = new Dictionary<A, string>();
A ta = new A();
ta.a = "a";
dic[ta] = "b";
A test = new A();
test.a = "a";
Console.WriteLine(dic.ContainsKey(test)); //这里输出的是false
}
}
public class A
{
public string a;
}