错误:
无效的表达式术语'string'
构造函数:
public Car(string make, string model, int condition, double price, int passenger)
:base(string make, model, condition, price)
Run Code Online (Sandbox Code Playgroud)
问题:在向base class构造函数发送参数时,您不需要使用datatype.
解决方案:string从base()参数中删除make
试试这个:
public Car(string make, string model, int condition, double price, int passenger )
:base(make, model, condition, price)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9439 次 |
| 最近记录: |