[Java in NetBeans] Lesson 11. While Loops
2024-10-19 02:25:02
这个课程的参考视频和图片来自youtube。
主要学到的知识点有:(the same use in C/C++)
1. while loop
- while(i < max){} will keep executing if i < max is true, otherwise will jump out from the while loop. Possible execute 0 times.
max = 5;
i = 0;
while(i < 5){
System.out.printf("%d ", i);
i++;}
// the result will be like this
0, 1, 2, 3, 4
- do {} while (i < max) is similar like before, only difference is that the loop body will be execute at least once.
- while(true) { if (i < max) {break;}} Whenever see break; will jump out from the while loop.
max = 5;
i = 0;
while(true){
System.out.printf("%d ", i);
i++;
if (i >= max){
break;}}
// the result will be like this
0, 1, 2, 3, 4
最新文章
- 打造高效前端工作环境-tmuxinator
- Linux实战问题解决方案(1):Could not get lock
- Hihocoder 1079 离散化
- easyui 中datagrid 点击行的事件
- angularjs实战
- Android中实现控件圆角边框
- Hibernate 持久化对象的状态
- Scala 编程(二)类和对象
- 安装sql server 2008 management studio时,提示升级VS2008 到 SP1
- paip.c++ qt messagebox用法
- V5
- leetcode(58)-Range Sum Query - Immutable
- Spring Boot笔记八:表单验证
- 只有设置了 name 属性的表单元素才能在提交表单时传递它们的值
- MDK编译过程
- Java并发编程(十)阻塞队列
- maven dependencies 报错
- ExtJS 4.2 教程-06:服务器代理(proxy)
- AngularJs - Javascript MVC 框架
- datatable删除一行方法
热门文章
- js中parseInt和Number
- 微信jssdk上传图片,一张一张的上传 和 一次性传好几张
- 有时候不用explode截取字符串了,可以用用substr()
- http://linux-mtd.infradead.org/doc/nand.html nand
- .NET Core开发日志——HttpClientFactory
- ubuntu16.04编译安装imu_tk
- [No0000D2]ClearCSharp编程清理脚本批处理bat
- flex-shrink (适用于弹性盒模型容器子元素)
- OLW Test
- Cookie映射