Before calling a method, you must first know what a method is.
A Java method is a collection of statements that together perform a function.
A method is an ordered combination of steps to solve a type of problem
Methods are contained in a class or object
Methods are created in the program and elsewhere Quoted
java method call
Java supports two ways of calling methods, which are chosen based on whether the method returns a value.
When a program calls a method, control of the program is given to the called method. Control is returned to the program when the return statement of the called method is executed or the method body closing bracket is reached.
When a method returns a value, the method call is usually treated as a value.
The above is the detailed content of How to call method in Java. For more information, please follow other related articles on the PHP Chinese website!