February 2016
Beginner to intermediate
500 pages
187h 36m
English
There are three ways to call a method:
Using a method name by itself to call another method of the same class—such as maximum(number1, number2, number3) in line 21 of Fig. D.2.
Using a variable that contains a reference to an object, followed by a dot (.) and the method name to call a non-static method of the referenced object—such as the method call in line 13 of Fig. C.3, myGradeBook.displayMessage(), which calls a method of class GradeBook from the main method of GradeBookTest.
Using the class name and a dot (.) to call a static method of a class—such as Math.sqrt(900.0) in Section D.3.
A static method can call only other static methods of the same class directly (i.e., using the method name by itself) ...
Read now
Unlock full access