Two main characteristics of an object:
Properties and Methods
1. Method:
The access modifier method returns a value type method name () {
The body of the method
}
1. No parameter method
There are return values such as:
Public String Play () {
Return value type is consistent with the returned value type of the method
return "hehe";
}
No return value for example: public void play () {
}
2. With the Parameter method
Allows mutual invocation between methods
2. member variables and local variables
A member variable refers to a variable in a class//can be used anywhere in a class! Java will give the member variable an initial value
Local variable refers to the method of the variable////can only be used inside the method, out of the way is not in! Java does not give initial values to local variables
Local variables have higher precedence in the same class when the member variable and local variable have the same name
3.JavaDoc
Five-parameter method of class