Is it possible to define an anonymous implementation of IComparer?
I believe Java allows anonymous classes to be defined inline - does C#?
Looking at this code I
Even though you can't create anonymous classes that implement interfaces, you can usually use the Comparison Delegate instead of the IComparer Interface in most cases (like sorting, etc.):
Array.Sort(arr, (x, y) => 1);
Also there are some built-in implementations of IComparer
like the Comparer Class or the StringComparer Class...