How to Use Comparer Class in C#

Hi Programmers,here is the article for comparer class in c#.It Performs a case-sensitive comparison of two objects
of the same type and returns a value indicating whether one is less than, equal to, or greater.
Here a,b are two objects.It return Zero when a equals b.Less than zero when a is less than b.
Greater than zero when a is greater than b. see below image.

Exceptions Generates when two objects are different types and
neither one can handle comparisons with the other. see below image.

Happy Coding…Thanks.

Post Author: adama