I don't have access to the book, but here's how I view the interface.
IComparable is used to allow two objects of the same type to be compared. This allows them to be sorted and ordered (such as when using sorted lists).
The method IComparable provides, CompareTo, simply compares the current object with the supplied parameter, returning 0 if the two items are identical, -1 if the instance is less than the parameter, and +1 if the instance is greater than the parameter.
/- Sam Judson : Wrox Technical Editor -/
|