Section II Java Process Control (loop structure)

Source: Internet
Author: User

? 1, for Loop
for(初始化表达式;循环条件表达式;循环后的操作表达式){        执行语句}

2. While loop
while(条件表达式){    执行语句}while循环特点是只有条件满足才会执行我们的循环体

3. Do While loop
do{    执行语句}while(条件表达式)    do while的特点是条件无论是否成立循环体至少都会被执行一次

例子:9*9乘法表


关键字

1. Break (jump)

1、break用在循环中,用来跳出当前循环执行下一个循环。2、break用在switch里面的时候我们是跳出当前的语句块

2, continue (continue)
Continue intelligently acts on our loop structure and continues to circulate

 
 

Section II Java Process Control (loop structure)

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.