首页 > 代码库 > for循环和while循环的区别

for循环和while循环的区别

 1 public class Xunhuanqubie { 2   public static void main(String[] args){ 3       int i = 0; 4       while(i<8){ 5           System.out.println(i); 6           i++; //i = i+1; 7       } 8       System.out.println("done");; 9   }10 }

技术分享

for循环和while循环的区别