Answer:
If any of strings value is null, string1.Equals(string2) will throw runtime error but
String.Equals(string1,string2) will not throw any error.
Example:
string str1=null;
string str2="abc";
str2.Equals(str1); // will give runtime error
String.Equals(str1,str2); //will not give any error
Asked In: HCL Technologies |
Alert Moderator