Difference between == and .Equals() in .Net
= = compare valus of variables
.Equals() compare Objects of variable
int x=10, double y=10
e.g
if(x==y)--true
if(x.equals(y)) false
= = compare valus of variables
.Equals() compare Objects of variable
int x=10, double y=10
e.g
if(x==y)--true
if(x.equals(y)) false
No comments:
Post a Comment