Java Return statement-return__java programming experience

Source: Internet
Author: User
The return statement is to jump to another program during the execution of the program. A general return statement is used in a subroutine or in a function method in a program. The return statement is indicated by using the keyword "return". The following is a simple example of how to use the return statement.
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 that this small program is over, returned to the main running program. There is also a situation, first look at the following example.
public int set () {
Return i=a*b
}
This situation not only returns to the main running program, but also brings the value of "i=a*b" back to the main run program, assigning its value to "I" in the main running program.

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.