Java Basics-Arrays & Methods

Source: Internet
Author: User

Method

Why should there be a way?

* Improve the reusability of code

What is a method?

* Block of code to complete specific functions

Format of the method?

Access modifier return value type method name (parameter type argument name) {

Method code block

return value;

}

Method Format Description:

    1. Modifier: Public protected private
    2. Return value: The data type of the result of this function
    3. Method Name: According to the naming rules, convenient for our call
    4. Parameters:
      • Actual parameters: The parameters that are actually involved in the operation
      • Formal parameter: The method definition that is used to accept the actual argument.
    5. Parameter type: Refers to the data type of the parameter
    6. Parameter name: Name of variable
    7. Method Body: The code that completes this function
    8. Return: The End method
    9. Return value: The result of the function, brought to the caller by return

Array

Java Basics-Arrays & Methods

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.