Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IComparer example #2
public class UserAgeComparer : IComparer
{
public int CompareTo(Object x, Object y)
{
User userX = x as User;
User userY = y as User;
if (userX != null & userY != null)
{
// compare the age.
}
else
{
return 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.