for循环

for循环,第1张

for循环
public class ForDemo{
   public static void main(String[] args){		
       //for循环		
       //输出1-100之间的数		
       				
       //计算1-100之间偶数的和		
       				
 		
 //for循环的写法		
 				
         int i = 0;		
         for(;;){			
             System.out.println("i = " + i);			
             i++;		
             }		
             //System.out.println(i);		
             //System.out.println("1-10的和:" + sum);				
             											
                     }
                 }

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5672687.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存