Java SE parameter transfer [1]

Source: Internet
Author: User

Parameter transfer Objects communicate with each other by passing messages.The message is implemented as a method call that can activate a specific method on the object. Static Methods in Java can be activated by classes. The parameters in a method call provide an information exchange method between the caller object and the called object (not necessarily the caller object. The method call syntax can be any of the following: <object reference>. <Method Name> (<actual parameter list>) <Class Name>. <Static Method Name> (<actual parameter list>) <object reference> must be an expression that can calculate object references. If the caller and the called method are the same object, the <object reference> can be omitted. <Class Name> is the full name of a class. Multiple parameters in <actual parameter list> are separated by commas. Even if the real parameter list is empty, brackets must exist. This feature distinguishes a method call from a constructed block of an access field, a constructed block that points out the complete identifiers of a class, and a packet that uses a point-to-point operator. Objref. doit (time, place); int I = java. Lang. Math. Abs (-1); somemethod (ofvalue); the vertex operator (.) has a left combination. Real parameters are some parameters passed to the method when the method is activated. These parameters can change with the call. Parameters defined in the parameter method definition are local variables for the method. Real parameters and form parameters must meet the following requirements: · The number of real parameters must be equal to the number of form parameters in the method definition. · Each of the corresponding parameter-real parameters must be compatible. 1. For the metadata type, the data value of the real parameter is passed. 2. If the real parameter is a reference to an object (for example, a class instance or an array), it will pass the reference value rather than the object itself. 3. If the real parameter is an array element of a metadata type, it will pass the data value of the array element. 4. If the array element points to the object reference, it will pass the reference value of the array element.
Data Value of the Parameter Passed Value
Metadata type Metadata Value
Class type Reference Value
Array type Reference Value
 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.