1

Possible Duplicate:
When to use IComparable<T> Vs. IComparer<T>

while IComparer works for both the cases.

Community
  • 1
  • 1
yesraaj
  • 46,370
  • 69
  • 194
  • 251

1 Answers1

0

As the name suggests IComparable is thing that can be compared and IComparar is an object that can compare other objects. If you want to compare two objects of same type then you will implement IComparable on it. If you want a type that can compare other objects then you will implement IComparer.

TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188