This method has been defined to take a parameter array of doubles. What
this method is in fact
saying is, “Send me any number of doubles and I’ll compute the average.” Given this, you can call
CalculateAverage() in any of the following ways (if you did not make use of the params modifier in
the definition of CalculateAverage(), the first invocation of this method would result in a compiler
error):
static void Main(string[] args)
{
Console.WriteLine("***** Fun with Methods *****");
...
Do'stlaringiz bilan baham: