I have a condition in a silverlight application that compares 2 strings, for some reason when I use ==
it returns false while .Equals()>
Really great answers and examples!
I would just like to add the fundamental difference between the two,
Operators such as
==
are not polymorphic, whileEquals
is
With that concept in mind, if you work out any example (by looking at left hand and right hand reference type, and checking/knowing if the type actually has == operator overloaded and Equals being overriden) you are certain to get the right answer.