One. The This keyword, the scenario used, and how to use it.
1. Conditions of Use
This is used in a method body in a class--initializes the object
Class is used in the constructor of this--reference, the object that invokes the method
2. Do not write this, call
As long as the method or constructor does not have a member variable with the same name as the local variable, you can simply not write this
Otherwise, a local variable is used in the method or in the constructor
3.static
A static method cannot call this and cannot invoke any member variable or method that is not static decorated
Two. Parameter passing properties in Java methods
1. Basic data Type--is actually a new variable, and is assigned a value but what the code does the original parameter is changed
2. Reference data Type--is actually a new variable, and points the memory address to the actual parameter as the memory changes, the original parameters will change
Three. Method recursion, need to pay attention to the static problem, as well as the dead loop problem, not much introduction
Four. Overloading of methods
Actually refers to the modifier return value method name the same parameter different n method called overload
Hint: parameter string ... A is actually equivalent to string [] A;
The This of the Java object uses the recursion of the parameter passing attribute method in the Java method