do...while02

package com.lyc.struct;

public class DoWhileDemo02 {
public static void main(String[] args) {
int a = 0;
while (a<0){
System.out.println(a);
a++;
}

System.out.println("=====================");

do {
System.out.println(a);
a++;
}while (a<0);

}
}
//无论条件成不成立 do while 都会先执行一次
//while先判断后执行。
//dowhile是先执行后判断!

/*
运行结果:

=====================
0

*/
原文地址:https://www.cnblogs.com/liuyunche/p/14243254.html