第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/

第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
java1.5版本以后for循环出了个加强的。

while循环语句

第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
利用循环结构计算100以内累加和的计算
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
100以内偶数奇数分别求和计算
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
}循环打印星星
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/

do while循环语句

第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
制作猜数游戏
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/

for循环语句

第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
表达式1只能被计算1次,布尔表达式最少1次或者n次,表达式3有可能由于布尔表达式是false所以会一次不运行,也可能是n次。
布尔表达式如果被省略,则会默认为true,会进入死循环。
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/

break强制跳出

for的无布尔表达式的死循环利用break强制跳出
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/

continue的使用

第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/

循环嵌套

第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
几种循环可以互相嵌套
内层的break和continue只影响内层的循环
如果内层循环开始执行了,外层循环是否能再次执行,取决于内层循环是否执行结束。
System.out.print("\r"); //也能换行

利用for循环嵌套制作打印九九乘法表
![在这里插入图片描述](https://img-blog.****img.cn/20200630191445864.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L25pdWJvNTE2,size_16,color_FFFFFF,t_70第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/

for循环迭代语句

第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/
在数组或者集合中进行查找操作
第七天-while,for,dowhile循环结构/循环中使用break和continue等关键字/