这个课程的参考视频和图片来自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的更多相关文章

  1. [Java in NetBeans] Lesson 10. For Loops

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有:(the same use in C/C++) 1. x++, x += 1; similar x--, x -= 1; x *= 2 ...

  2. [Java in NetBeans] Lesson 07. JavaDoc and Unit Tests

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. organize code into packages Create a package if want to make th ...

  3. [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 ...

  4. [Java in NetBeans] Lesson 17. File Input/Output.

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) ...

  5. [Java in NetBeans] Lesson 16. Exceptions.

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) ...

  6. [Java in NetBeans] Lesson 15. Sorting and Searching.

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Build in functions in java.util.Collections Need to implement a co ...

  7. [Java in NetBeans] Lesson 09. Switch / If-Else Ladder

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. Nested If-else statement (if-else ladder) /** * 90 and above == ...

  8. [Java in NetBeans] Lesson 06. Custom classes

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Constructors: A special method called when an object of the class ...

  9. [Java in NetBeans] Lesson 05. Method/function

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Define a method:(motivation: write one time, but use it many times ...

随机推荐

  1. I - Cows

    来源 poj 3348 Your friend to the south is interested in building fences and turning plowshares into sw ...

  2. AngularJS快速教程

    作者:arccosxy  转载请注明出处:http://www.cnblogs.com/arccosxy/ AngularJS是Google开源的一款JavaScript MVC前端框架,弥补了HTM ...

  3. Win 10 计算机管理失效(Windows找不到文件“C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Computer Management.lnk)

    Windows找不到文件“C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Computer Mana ...

  4. GEM5安装

    转自:http://blog.sina.com.cn/s/blog_548b0a230101cagk.html GEM5在ubuntu13.10下安装过程,首先下载gem5_stable最新安装包,解 ...

  5. java虚拟机学习

    //20181129 ·Java虚拟机的内存分为三个部分:栈stack.堆heap.方法区method area----包含在“堆”里面,因为作用特殊所以单独列出来 ·栈的特点:     栈描述的是方 ...

  6. ubuntu创建用户的两种方式

    ubuntu创建用户有两种方式: useradd和adduser 这两者,就像零件与产品的关系.useradd是DIY,需要自己调配,adduser是品牌机,拿来就能用. 对于创建一般用户来讲,use ...

  7. Rabbitmq关于集群节点功能的读书笔记

    消息和队列可以指定是否持久化,如果指定持久化则会保存到硬盘上 ,不然只在内存里 普通集群模式下持久化的队列不能重建了 内存节点和磁盘节点的区别就是将元数据放在了内存还是硬盘,仅此而已,当在集群中声明队 ...

  8. Git 子模块:git submodule

    imtianx 2018年03月08日阅读 2057 Git 子模块:git submodule 工作中,可能会遇到在一个Git仓库 中添加 其他 Git 仓库的场景.比如,在项目中引用第三方库.或者 ...

  9. mysql帮助命令

    HELP contents 查看MySQL命令的使用. eg: HELP 'Data Type' 查看所有的数据类型的使用方法.

  10. iOS 动画学习之视图控制器转场动画

    一.概述 1.系统会创建一个转场相关的上下文对象,传递到动画执行器的animateTransition:和transitionDuration:方法,同样,也会传递到交互Controller的star ...