Home >Java >javaTutorial >What are java formal parameters

What are java formal parameters

little bottle
little bottleOriginal
2019-05-25 13:42:327582browse

Java is an object-oriented programming language. Java has the characteristics of simplicity, object-oriented, distributed, robustness, security, platform independence and portability, multi-threading, and dynamics. Let’s talk to you about what java formal parameters are.

What are java formal parameters

#The actual parameters of java refer to the parameters passed to the function when calling, that is, the value passed to the called function.

Actual parameters can be constants, variables, expressions, functions, etc. No matter what type of quantity the actual parameters are, they must have a certain value when making a function call. in order to pass these values ​​to the formal parameters.

The formal parameters of java refer to the parameters used when defining the function name and function body. The purpose is to receive the parameters passed in when calling the function.

The formal parameter is the independent variable of the function, and its initial value comes from the call of the function. Only when a function is called during program execution, can the formal parameters obtain specific values ​​and participate in calculations to obtain the function value.

The visible formal parameter list is equivalent to the variable description, but special attention should be paid: only type identifiers can be used here, and types cannot be used directly.

When calling a function, the actual parameters will be assigned to the formal parameters.

Therefore, we must pay attention to the number of actual parameters, the type should correspond one-to-one with the formal parameters, and must have a certain value.

The above is the detailed content of What are java formal parameters. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn