1 Functions in Java: Methods
2 mathematical operators
1. Java method Methods (function functions), functions, actions
1) The method is the function: Y=f (x) =3x+6; 2)
Syntax of the method
(modifier words) (return value type) (Method Name) (parameter list) {
Method body
}
public static void Main (string[] args) {}
Such as:
public static int f (int x) {
int y = 3 * x + 4;
return y;
}
4) If there is a return value definition there must be a return statement, return and return value type
Compatible data
5) The parameters of the method and the variables inside the method are local variables,
These variables are scoped only inside the method!
6) Arguments: parameter variables that are actually passed when the method is called
Parameters: The parameter definition of a method, which is a temporary variable.
The manager asked today about Java functions and scopes