[Java in NetBeans] Lesson 11. While Loops
这个课程的参考视频和图片来自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
[Java in NetBeans] Lesson 11. While Loops的更多相关文章
- [Java in NetBeans] Lesson 10. For Loops
这个课程的参考视频和图片来自youtube. 主要学到的知识点有:(the same use in C/C++) 1. x++, x += 1; similar x--, x -= 1; x *= 2 ...
- [Java in NetBeans] Lesson 07. JavaDoc and Unit Tests
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. organize code into packages Create a package if want to make th ...
- [Java in NetBeans] Lesson 00. Getting Set-up for Learning Java
这个课程的参考视频在youtube. 主要学到的知识点有: set up needs Java SE JDK, NetBeans IDE class name should be the same l ...
- [Java in NetBeans] Lesson 17. File Input/Output.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) ...
- [Java in NetBeans] Lesson 16. Exceptions.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) ...
- [Java in NetBeans] Lesson 15. Sorting and Searching.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Build in functions in java.util.Collections Need to implement a co ...
- [Java in NetBeans] Lesson 09. Switch / If-Else Ladder
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. Nested If-else statement (if-else ladder) /** * 90 and above == ...
- [Java in NetBeans] Lesson 06. Custom classes
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Constructors: A special method called when an object of the class ...
- [Java in NetBeans] Lesson 05. Method/function
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Define a method:(motivation: write one time, but use it many times ...
随机推荐
- Jenkins Docker安装及Docker build step插件部署配置
生产部署环境:A:192.168.1.2 B:192.168.1.3 两台服务器系统均是Centos 7.3 , Docker版本都1.12.6 Jenkins安装操作步骤: 1.在A服务器上使用命 ...
- Spark RDD Transformation 简单用例(二)
aggregateByKey(zeroValue)(seqOp, combOp, [numTasks]) aggregateByKey(zeroValue)(seqOp, combOp, [numTa ...
- maven 配置mirror后,本地库与远端库冲突
settings.xml中主要包括以下元素: localRepository interavtiveMode offline pluginGroups proxies servers mirrors ...
- 《手机端》让多出的导航变水平拖动,不让他 float 撑下去
/********** 网站底部 **************/ .nav{;;;;white-space: nowrap;overflow: auto;-webkit-overflow-scroll ...
- 【转】asp.net项目在IE11下出现“__doPostBack”未定义的解决办法
最近我们运营的网站有用户反馈在 IE 11 下<asp:LinkButton> 点击出现 "__doPostBack"未定义",经过一番google,终于知道 ...
- Cobbler 登录web界面提示报错“Internal Server Error”解决办法
Cobbler登录web页面报错 查看httpd日志/etc/httpd/logs/ssl_error_log 查看cobbler的py配置文件 sed -n '38,41p' /usr/share/ ...
- pfSense软件防火墙安装配置
一,说明 1.1 pfSense是什么 pfSense是基于FreeBSD的.开源中最为可靠(World's Most Trusted Open Source Firewall)的.可与商业级防火墙一 ...
- ie9 form submit 请求参数问题替代办法
//隐藏表单 <input id="hdPeriod" name="period" type="hidden" value=" ...
- 将音乐生成波浪图形,JavaScript Html5
x 省略废话(N+)... Windows Media Palyer中的经典波浪形 自己也行动手做一个,最好是JavaScript实现的, 搜索到了资源部分关键词"HTML5 频谱" ...
- NLP任务:给定一句话,找出这句话中你想要的关键词,包括起始结束索引
在实际的nlp实际任务中,你有一大堆的人工标注的关键词,来新的一句话,找出这句话中的关键词,以便你以后使用,那如何来做呢? 1)用到正则的 finditer()方法,返回你匹配的关键词的迭代对象,包含 ...