System.IComparable<T>

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Johansson

    System.IComparable<T>

    Hello!¨

    I read a book and here it says that it's most often an advantage to
    implement the generic interface IComparable<T>
    instead of the general interface IComparable. This is correct!

    Now to my question this book also say that both interfaces can be
    implemented something that some of the types in .NET does.

    I can't see any point in implementing both interfaces?? Can you ??

    //Tony





  • Marc Gravell

    #2
    Re: System.ICompara ble&lt;T&gt;

    Yes; it means that anything that doesn't know about the generic side
    (ArrayList, or a data-grid) can still sort the data.

    Marc

    Comment

    Working...