????3.Equals????д
?????????????????
????string a = new string(new char[] { 'h'?? 'e'?? 'l'?? 'l'?? 'o' });
????string b = new string(new char[] { 'h'?? 'e'?? 'l'?? 'l'?? 'o' });
????Console.WriteLine(a == b);         //true
????Console.WriteLine(a.Equals(b));    //true
????????????a ??b ???????????????Equals?True??????????“Equals??????????????????????????“?????????????????String???е?Equals??????
????public override bool Equals(Object obj) <br>       {
????if (this == null)                        //this is necessary to guard against reverse-pinvokes and
????throw new NullReferenceException();  //other callers who do not use the callvirt instruction
????String str = obj as String;
????if (str == null)
????return false;
????if (Object.ReferenceEquals(this?? obj))
????return true;
????if (this.Length != str.Length)
????return false;
????return EqualsHelper(this?? str);
????}
????public bool Equals(String value) <br>       {
????if (this == null)                        //this is necessary to guard against reverse-pinvokes and
????throw new NullReferenceException();  //other callers who do not use the callvirt instruction
????if (value == null)
????return false;
????if (Object.ReferenceEquals(this?? value))
????return true;
????if (this.Length != value.Length)
????return false;
????return EqualsHelper(this?? value);
????}
????????????String???в?????д??Object?е?Equals?????????Equals????????????????????????????????????????????????????????????????Equals??????????????????????????????ο????????????д??????塣??????дEquals???????????????????????????HashMap??HashSet??Hashtable???????????дGetHashCode()??
????4.???????“==”?????Equals??
?????й?????仰??“?κ??????????????????????????”?????“==”??Equals????????“==” ???????????л???????????????????????????????£???????????????????????????????????????????????????????????????????????????????????е?????????????????? “???????????“ ??????????????????????? ?磺String???????????????????????????????????????е?????????????????????????????????????????λ??????Σ????????????????????????????е?????????????????????????????????????????????????????????????????????????????????????????????????????????λ???????????” ????????????????????“ ?????????????????????
????5.“==”??Equals???????????
????”==“ ???????Equals??????????????????????”==“ ??????????????????? ”?????????????????????” ??????????Equals??????????????????????????????????????????????????????????????????????????????????????????Object?????Equals??Visual????????ж???д?????????????????????????????????????????????????????????????棺
????object g = a;
????object h = b;
????Console.WriteLine(g == h);         //false
????Console.WriteLine(g.Equals(h));    //true
???????Object???????????????????“==”????????“==”??????????????????????洢?????????????????Equals???????String???е?Equals?????g???????????????????????????????????????????Object???????Visual studio??????????????????????????
???????κζ??????????????”==“??Equals???????