我无法阅读这行代码
public Wine (decimal price, int year) : this (price) { Year = year; }
Run Code Online (Sandbox Code Playgroud)
什么:this
在构造函数中的关键字做
public class Wine
{
public decimal Price;
public int Year;
public Wine (decimal price)
{
Price = price;
}
public Wine (decimal price, int year) : this (price)
{
Year = year;
}
}
Run Code Online (Sandbox Code Playgroud)