錯誤1 'Koordinates.Vieta' 不實現接口成員 'System.IComparable.CompareTo(對象)'不實現System.IComparable.CompareTo(對象)
的代碼:
public class Vieta : IComparable //error is thrown here, on "Vieta"
{
public double x, y;
//constructor
public Vieta(double a, double b)
{
x = a; y = b;
}
//read only parameter
public double ilgis
{
get
{
return Math.Sqrt(x * x + y * y);
}
}
public int CompareTo(Vieta other)
{
if (other == null) return 1;
return other.ilgis.CompareTo(this.ilgis);
}
}
非常感謝 –