5.Java Return Statement-return

Source: Internet
Author: User

The return statement is the process of executing the program, jumping to another program. A general return statement is used in a function method in a subroutine or program. The return statement is expressed using the keyword "return". The following is a simple example of how the return statement is used.
public void set (int a,int b) {
I=a*b
Return
}

The above is a small program section, the return keyword appears in the program, indicating the end of the applet, return to the main running program. In another case, let's take a look at the following example.
public int set () {
Return i=a*b
}

This is not only to return to the main run program, but also to take the value of "i=a*b" back to the main runner and assign its value to "I" in the main runner.

5.Java Return Statement-return

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.