The IEquatableT Interface


The IEquatable<T> Interface

C# 2.0 adds the new interface IEquatable<T>, which is implemented by those classes that need to define how two objects should be compared for equality. It defines only one method, Equals( ), which is shown here:

 bool Equals(T obj)

The method returns true if obj is equal to the invoking object and false otherwise.

IEquatable<T> has been retrofitted to several classes and structures in the .NET Framework, including the numeric structures and the Char, Int32, Boolean, and String classes.




C# 2.0(c) The Complete Reference
C# 2.0: The Complete Reference (Complete Reference Series)
ISBN: 0072262095
EAN: 2147483647
Year: 2006
Pages: 300

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net