摘要:
while是最基本的循环,只要判断条件符合就会一直执行下去 while(布尔表达式){ //循环执行的内容 } public class for0915{ public static void main(String[] args) { int count = 0; while (count < 1 阅读全文
摘要:
对于while而言,不满足条件,它一次也不会执行,但是有的实际场景是即使不满足条件也让程序执行一次。 do...while循环和while循环相似,不同的是do...while循环至少会执行一次。 public class for0915{ public static void main(Strin 阅读全文
摘要:
break的用法: 1.break用于switch语句中,终止switch语句2.break用于循环时,跳出循环3.break用于其他位置,毫无意义 1. break用于switch语句中,终止switch语句 public class for0915{ public static void mai 阅读全文