含有默认参数的方法的声明:
public static double Function(double diameter1 , double diameter2 = 0.00)
{
return diameter1 + diameter2;
}
方法的使用:
double result1 = Function(520.99);
double result2 = Function(520.99 , 1);
含有默认参数的方法的声明:
public static double Function(double diameter1 , double diameter2 = 0.00)
{
return diameter1 + diameter2;
}
方法的使用:
double result1 = Function(520.99);
double result2 = Function(520.99 , 1);