amespace Traffic
{
class Program
{
static void Main(string[] args)
{
AddPassenger(new Compact());
AddPassenger(new SUV());
AddPassenger(new Pickup());
AddPassenger(new PassengerTrain());
}
static void AddPassenger(IPassengerCarrier Vehicles)
{
Console.WriteLine(Vehicle.ToString());
}
}
}
错误提示为:对象引用对于非静态的字段、方法或属性,object.string()是必须的?