You’ve seen three ways to call a method:
1. Using a method name by itself to call a method of the same class—such as
Maximum(number1, number2, number3) in line 18 of Fig. 7.3.
2. Using a variable that contains a reference to an object, followed by the member access (
.) operator and the method name to call a non-
static method of the referenced object—such as the method call in line 13 of Fig. 6.10,
myGradeBook.DisplayMessage(), which calls a method of class
GradeBook from the
Main method of
3. Using the class name and the member access (
.) operator to call a
static method of a class—such as
Convert.ToDouble(Console.ReadLine()) in lines 13–15 of Fig. 7.3 or
Math.Sqrt(900.0) in Section 7.3 ...