您的位置:首页 > 其它

while,do while循环结构

2016-10-25 16:54 120 查看
class Demo13 

{

       public static void main (String[] args)

     {   int a=1;

        while (a<=5)                                                 //while

        {

               System.out.println("hello world!") ;

               a++;//++就是加1

         }

   }

}

class Demo13

{

     public static void main (String[] args)

  { 

  int b =1;

  do{

         System.out.println("hello world!");

         b++;

       }

      while(b<=5);

   }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: