Examples of implicit parameters and display parameters in Java

In the process of learning Java, we will encounter many problems. Let's take a look at what implicit parameters and display parameters are.

Explicit parameters are usually seen in the middle of the method name brackets, which are the so-called visible parameters.

The implicit parameter is the instance domain of the class in the class method. The called instance domain is an implicit parameter. In the following class, a.ariseSalary (100) is invoked, and implicit parameters are used. For example:

In the above class, if this method is called, salary is the instance domain, and salary in the arisesalary method is the implicit parameter. If this is added before the implicit parameter, the implicit parameter is clearer:

It is recommended to prefix implicit parameters with the this operator. The this operator represents this class.

PS: let's introduce the implicit parameters and display parameters in Java through a piece of code

The specific code is as follows:

All right, that's the end of the code.

If you want to know more, please pay attention to programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>