摘要:
System.Icomparable接口指定了一种允许一个对象可基于其些特定键值进行排序行为,以下是正式定义public interface IComparable{ int CompareTo(Object o);}不说太多废话,直接看例子,更直接public class Car{ private int carID; private string carName; public int ID ... 阅读全文
摘要:
请先看下面一断代码public class Point:ICloneable{ private int x; public int X { get { return this.x; } set { this.x = value; } } public Point(int x) { this.x = x; } public override string ToString() { return st... 阅读全文