Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.
I. Method of parameter transfer
1. Normal parameter transfer: Request a data type, call a method to pass the address, modify the print value,
2. Set parameter pass (infinite parameter): Infinite parameter is the avatar of the array, can request a multidimensional array as an infinite parameter.
3. Reference parameter passing: request an array, reference a method to pass a value,
4. Method Overload: The method name, the method parameter type and number of different, in the case of duplicate method name can be used, change the parameters for a bit, do not change the meaning, but different types of parameters, different types of printing is not the same, the same method name can run different code, but the parameters must not be the same, Otherwise, it doesn't make sense.
Two. return value
1. The return value is a number returned when the condition is satisfied, it can only be a type, such as: array type, basic type, other types;
2. Once the method requests the return value, it must have a return;
There are two cases of 3.return:
① the results back out;
② End method.
Note: You cannot write any more code after return.
Three. Recursion 1. Recursion is the method call method, is a layer of nested one layer,
2. Use recursion to be aware that the number of nesting is limited, if the memory is more than the scope of use, support will be error, the number of nesting is based on the computer configuration decision.
Java Basics-Method