Keywords for Java

Source: Internet
Author: User

While and for can be interchanged.
The difference is that if you need to define a variable control loop number. It is recommended to use for. Because the For loop is complete, the variable is freed in memory.
Break: Acts on a switch, and a loop statement, used to jump out, or to be called an end.

When a break statement exists separately, the following do not define other statements, because the compilation fails because it is not executed. When a loop is nested, break only jumps out of the current loop. To jump out of a nested outer loop, just give the loop a name, which is called a label.
Continue: Only for loop structure, continue to recycle.
Effect: End this cycle and continue the next cycle. When the statement is present alone, the statement below cannot be defined and cannot be executed.

Keywords for Java

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.