I would like to be sure. If I apply == operator between two operands of type class, it returns true when both variables points at the same object?
Also like in string class, to check equality based on e.g. some value, I would need to override that operator. IS that true?
I would like to be sure. If I apply == operator between two operands
Share
For the second question, to give == a special meaning, you do indeed need to overload (not override) the operator (and != at the same time):
If you’re overloading == you should almost certainly also:
IEquatable<T>