[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 ...
随机推荐
- 01List.ashx(班级列表动态页面)
01List.html <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <he ...
- 让jQuery的contains方法不区分大小写
// NEW selector jQuery.expr[':'].Contains = function(a, i, m) { return jQuery(a).text().toUpperCase( ...
- zynq里面的AXI总线(2017-1-11)
在ZYNQ中有支持三种AXI总线,拥有三种AXI接口,当然用的都是AXI协议.其中三种AXI总线分别为: AXI4:(For high-performance memory-mapped requir ...
- VS2015 工具箱 保存位置
我的文档\Visual Studio 2015\Settings\CurrentSettings.vssettings Environment_Toolbox 节点 <Category name ...
- STL的基本介绍
STL是标准模板库,现在是c++的一部分 STL被组织为下面的17个头文件:<algorithm>.<deque>.<functional>.<iterato ...
- Rabbitmq关于集群节点功能的读书笔记
消息和队列可以指定是否持久化,如果指定持久化则会保存到硬盘上 ,不然只在内存里 普通集群模式下持久化的队列不能重建了 内存节点和磁盘节点的区别就是将元数据放在了内存还是硬盘,仅此而已,当在集群中声明队 ...
- oplog
参考资料:https://www.cnblogs.com/ruizhang3/p/6539730.html http://www.jb51.net/article/113432.htm :insert ...
- 转:Java 集合详解
原文地址:https://www.cnblogs.com/ysocean/p/6555373.html 一.集合的由来 通常,我们的程序需要根据程序运行时才知道创建多少个对象.但若非程序运行,程序开发 ...
- SQL instr()函数的格式
格式一:instr( string1, string2 ) / instr(源字符串, 目标字符串) 格式二:instr( string1, string2 [, start_positio ...
- 《Redis 集群》
由于集群这章节内容较多,也比较重要,所以单独拉出来,做一个小章节. 1:如何搭建一个集群? - 环境为 Ubuntu16.04 - 这里我预计使用 9001 - 9006 端口,生成一个 6 台机器的 ...