Abstract classes, Interfaces, and Patterns
- slide 15 : 37
Sample use of IComparable
Object of classes that implement
IComparable
can be sorted by a method such as
Array.Sort
A reproduction of the interface IComparable.
The generic interface IComparable
The interface IComparable in System
x.CompareTo(y)
Negative:
x
is less than
y
Zero:
x
is equal to
y
Positive:
x
is greater than
y
Comparable Dice