while:
int a =1;//初始化条件
while (a<=100){//条件判断
System.out.println(a);//循环体
a +=2;//迭代
for
//初始化条件 条件判断 迭代
for (int i =1;i<=100;i++){
System.out.println(i);
while:
int a =0;
int sum =0;
while (a<0){
System.out.println(a);
a++;
do while
do{
System.out.println(a);
a++;
}while (a<0);
区别
while 和do while 区别
//while:先判断后执行 do while 先执行后判断
//Do while 至少执行一次