码迷,mamicode.com
首页 > 编程语言 > 详细

JAVA循环

时间:2020-03-09 18:05:22      阅读:48      评论:0      收藏:0      [点我收藏+]

标签:generate   generated   dash   oid   class   i++   for循环   ring   static   

 1 public class  Xunhuan {
 2 
 3     public static void main(String[] args) {
 4         // TODO Auto-generated method stub
 5         
 6         //for循环输出0——10
 7         for(int i=0;i<=10;i++) {
 8             System.out.println(i);      //输出
 9         }    
10         
11         //while循环输出0——10
12         int x=0;
13         while(x<10) {
14             System.out.println(x);
15             x++;
16         }
17         //do...whlie循环输出0——10
18         int n=0;
19         do {
20             System.out.println(n);
21             n++;           //自加1
22         }while(n<10);        
23     }
24 }

 

JAVA循环

标签:generate   generated   dash   oid   class   i++   for循环   ring   static   

原文地址:https://www.cnblogs.com/wuxioaxian/p/12449671.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!