1: Method (1) Method: is the block of code that completes a particular function. Note: In many languages there is a definition of a function, whereas in Java, a function is called a method. (2format: Modifier Returns a value of type method name (argument type parameter name 1, argument type parameter Name 2 ...) {method body statement; returnreturn value; } modifier: Use now Public Static. Further details on other modifiers return value types: is the data type method name of the functional result: it is a name that makes it easy for us to call the method. Parameter type: is the parameter's data type parameter name: is the variable parameter classification: argument: The actual participation in the operation of the data parameter: method defined, to receive the actual parameters of the variable method body statement: Is the completion of the function of the generation Code blocksreturn: End method Return value: Is the result of the function, which is brought to the caller by return. (3) Two explicit: return value type: The data type parameter list of the result: the number of parameters and the corresponding data type (4method call A: There is an explicit return value of method A: Called Alone, meaningless B: The output call is not good because I may not need the result for further action. But I used the lecture in general. C: Assignment invocation, recommended scheme b:void type modification method A: called Separately (5) Case: A: Sum scheme B: Get the larger value in two numbers C: compare two data is the same D: Gets the maximum value in three number E: The star of the output m row n column F: output nn multiplication table (6) Method A: method does not call do not execute B: method is a peer relationship, cannot nest definition C: Method definition, parameter is used, separated by the D: Method at the time of invocation, do not pass data type E: if Method has a definite return value type, it must return with a return statement. (7method overloads for: The method functions the same, the parameter list is different, in order to see the name, Java allows them to play the same name. In the same class, the method name is the same, and the parameter list is different. Is independent of the return value. Parameter list is different: The number of parameters is different. The corresponding data type of the parameter is different. (8method overloads the case for different types of comparisons of multiple methods with the same name.
Fifth day of Java learning