I'm fairly new to C# (6 months on the job experience), but it seems pretty similar to Java so I feel right at home.
However, today I tried implementing the IComparer interface and wondered why it was giving me an error:
public class AlphabeticalReportSort : IComparer
{
int Compare(Object x, Object y)
{
return 0;
}
}
It seems like it requires you to implement it as:
public class AlphabeticalReportSort : IComparer
{
int IComparer.Compare(Object x, Object y)
{
return 0;
}
}
I didn't notice anything in the interface declaration that would require this, and it seems like in C# you don't normally need to do this.
Anybody know why?