January 2011
Intermediate to advanced
1648 pages
70h 30m
English
One of the most commonly overloaded operators is == (and its != sister operator). To ensure expected behavior for those operators, a few guidelines exist. In particular, we have to explain the relationship between the operators and the System.Object Equals methods that are available.
System.Object’s Instance Equals MethodDefined on System.Object, the “mother type of all types”, the Equals instance method is used to compare whether two objects are “equal,” whatever that means for the types of the target object and the one being compared.

As you learn in Chapter 14, “Object-Oriented Programming,” virtual ...
Read now
Unlock full access