这个课程的参考视频和图片来自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. C++编程相关工具

    1 文档类  (1) Doxygen  参考站点:http://www.doxygen.org  Doxygen是一种适合C风格语言(如C++.C.IDL.Java甚至包括C#和PHP)的.开放源码的 ...

  2. eclipse下配置Spring环境

    工具: jdk1.8 win10 spring5.0 1.准备工作:下载Spring开发应用的插件,api 1.spring插件包:springsource-tool-suite-3.9.4.RELE ...

  3. secureCRT修改背景色、字体颜色

    参考: http://blog.csdn.net/jediael_lu/article/details/37729465 http://blog.csdn.net/dagefeijiqumeiguo/ ...

  4. asp.net 访问页面访问统计实现 for iis7

    上一篇博文中< asp.net 访问页面访问统计实现  > 中在win10 (iis8+)上运行没有问题, 但客户机子是windows server 2008  的 iis7弄死不对,最好 ...

  5. 160道Java技术面试题

    1.面向对象的特征有哪些方面?2.访问修饰符public,private,protected,以及不写(默认)时的区别?3.String 是最基本的数据类型吗?4.float f=3.4;是否正确?5 ...

  6. robot framework ——关键字run keyword if 如何在一个条件下接多个执行语句,以及如何写复杂条件句

    曾一度疯狂搜索run keyword if 的用法,帖子是挺多的,可惜,没有一个我想要的.现在我终于把我想要的用法,收集好了,在此总结下. 1.曾经天真的以为  run keyword if +条件 ...

  7. CodeForces 1099F - Cookies - [DFS+博弈+线段树]

    题目链接:https://codeforces.com/problemset/problem/1099/F Mitya and Vasya are playing an interesting gam ...

  8. 【紫书】uva489 Hangman Judge 做了很久Orz

    题目链接:https://vjudge.net/problem/UVA-489 题意:给出两行字符串,第一行是标准答案,第二行是玩家猜的串.玩家每次猜一个,猜对一个,标准答案中所有该字符都算被猜到.猜 ...

  9. readonly enable

    <input type="text" id="UserName" style="width:20%;" disabled=" ...

  10. C 缓冲区过读 if (index >= 0 && index < len)

    C 缓冲区过读 if (index >= 0 && index < len) CWE - CWE-126: Buffer Over-read (3.2) http://cw ...