while 与do while的区别
do....while 与while 的区别
while 先判断后执行,do while是先执行后判断
do while 总是保证循环体会被至少执行一次
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);
}