June 2017
Beginner
1296 pages
69h 23m
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 18 of Fig. 6.3.
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 14 of Fig. 3.2, myAccount.getName(), which calls a method of class Account from the main method of AccountTest. Non-static methods are typically called instance methods.
Using the class name and a dot (.) to call a static method of a class—such as Math.sqrt(900.0) in Section 6.3.
There are three ways ...
Read now
Unlock full access