为什么当我使用这个类(称为 TaxiStation)时,它调用了出租车类的 toString:
public override string TaxiInformation(int i)
{
return taxiCollectionDrivers[i].ToString();
}
Taxi 类的 ToString():
public override string ToString()
{
string str;
str = "Taxi ID: " + this.taxiId + "\nDriver Name: " + this.driverName + "\nPassengers " + this.numPass + "\nTotal Passengers: " + totalPassengers + "\nRate Per Kilometer: " + this.ratePerKilometer+
"\n\n Available: " + this.available ;
return str;
}
它告诉我没有找到合适的方法来覆盖的错误?我该如何解决?