Comparisons work out-of-box only for primitive types. For others they need to be defined.
Comparisons do not work well with inheritance. It's not recommneded to implement comparisons on unsealed classes.
This interface defines CompareTo
method that returns int
:
- -1 (less then)