public class PersonComparerName : IComparer
{
public static IComparer Default = new PersonComparerName();//这一行看不懂
public int Compare(object x, object y)
{
if (x is Person && y is Person)
{
return Comparer.Default.Compare(((Person)x).Name, ((Person)y).Name);
}
else
{
throw new ArgumentException(".....");
}
}
}
婷婷同学_
PIPIONE
随时随地看视频慕课网APP
相关分类