• 基础语法-循环结构do...while


                基础语法-循环结构do...while

                                           作者:尹正杰

    版权声明:原创作品,谢绝转载!否则将追究法律责任。

     

     

     

    一.do...while语句格式

    do{
      执行语句;
    }while(条件表达式);


    温馨提示:
      do...while特点是条件无论是否满足,循环体至少被执行一次。

    二.do...while案例

    /**
     *     do while案例
     * @author 尹正杰
     *
     */
    public class DoWhileDome01 {
    
        public static void main(String[] args) {
                int x = 100;
                
                /*
                 *     温馨提示:
                 *         不管while中的条件表达式是否为true,do里面的代码至少回执行一次。
                 */
                do {
                    System.out.println("x = " + x);
                    x += 50;
                }while(x > 200);
                
                System.out.println("x = " + x);
        }
    
    }

     

  • 相关阅读:
    Xcode And iOS9新特性
    AutoLayout
    本地化
    Map
    iOS多线程编程
    第三方抽屉效果
    iPad编程
    CoreData / MagicalRecord
    js清除单选框所选的值
    js获取背景颜色
  • 原文地址:https://www.cnblogs.com/yinzhengjie2020/p/12214492.html
Copyright © 2020-2023  润新知