Parameter Modifiers定义了函数如何接收参数
示例
public void CalculateTax(double percentage = 4.5)
//CalculateTax method to calculate tax
/*cost <= 20000 then tax = 10%
cost > 20000 then tax = 12.5%*/
public void CalculateTax(double percentage = 4.5)
{
//create local variable
double t;
//calculate tax
if (this.cost <= 20000)
{
t = cost * 10 / 100;
}
else
{
t = cost * percentage / 100;
}
tax = t;
}