错误 1 'Koordinates.Vieta' 未实现接口成员 'System.IComparable.CompareTo(object)'
编码:
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);
}
}