这个课程的参考视频和图片来自youtube

主要学到的知识点有:(the same use in C/C++)

1. x++, x += 1; similar x--, x -= 1; x *= 2; x /= 2.

  • x++ : Plus 1 after  the line is executed. similar x--
x = 2;
System.out.printf(" x is now : %d", x++);
System.out.printf(" x is : %d", x);

The result of above, is

x is now : 2
x is : 3
  • x += 1      equals   x = x + 1; similar x -= 1; x *= 2; x /= 2.

2. For loop

  • for (int i = 0; i < max; i ++){}   will go through 0  unitl max -1, but intotal is max.

  • for (int i = 1; i <= max; i ++){}   will go through 1  unitl max, but intotal is max.
  • Similar for (int i = max; i > 0; i --){} will go through max  unitl 1, but intotal is max.
  • for (int each : numArray) {}  will go through each element/object in the array/collections.
int[] numArray = new int[] { 3, 4, 5, 8};
for (int each: numArray){
System.out.printf("%d "); }

the results of above will be like

3 4 5 8 

[Java in NetBeans] Lesson 10. For Loops的更多相关文章

  1. [Java in NetBeans] Lesson 11. While Loops

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有:(the same use in C/C++) 1. while loop while(i < max){} will keep ...

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

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

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

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

  4. [Java in NetBeans] Lesson 04. Class / Objects

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Class: Blueprint for an object. (e.g. dog is a class) Object: cust ...

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

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

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

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

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

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

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

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

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

随机推荐

  1. elasticsearch.yml配置文件

        Elasticsearch的配置文件在config文件夹下,其中有elasticsearch.yml.logging.yml两个配置文件,其中elasticsearch.yml是用来配置Ela ...

  2. C语言迷题:有符号数与无符号数的问题(转)

    https://my.oschina.net/kelvinfang/blog/134725

  3. class in Bad version

    异常信息:class in Bad version:jdk版本不对

  4. confd template src格式和 templates 语法

    Template Resources Template resources are written in TOML and define a single template resource. Tem ...

  5. 遇到问题无法在线上 debug,难道只能通过加日志再重新发布吗? 线上遇到某个用户的数据处理有问题,但线上同样无法 debug,线下无法重现! 是否有一个全局视角来查看系统的运行状况? 有什么办法可以监控到JVM的实时运行状态?

    https://alibaba.github.io/arthas/ Arthas 是Alibaba开源的Java诊断工具,深受开发者喜爱. 当你遇到以下类似问题而束手无策时,Arthas可以帮助你解决 ...

  6. [daily][centos] redhat增加扩展仓库

    https://rpmfusion.org/Configuration sudo yum localinstall --nogpgcheck https://download1.rpmfusion.o ...

  7. [knowledge] big data things

    http://hadoop.apache.org/ https://spark.apache.org/ https://nifi.apache.org/ https://www.cloudera.co ...

  8. 转:web.xml 配置中classpath: 与classpath*:的区别

    原文链接:web.xml 配置中classpath: 与classpath*:的区别 引用自:http://blog.csdn.net/wxwzy738/article/details/1698393 ...

  9. selenium+xpath在不同层级的写法

    总结:定位虽然用Inndex定位最快,但是定位最好不要用浏览器自带定位xpath,尽量不要用Index,否则写的UI自动化脚本的定位元素,需要重新维护.代价太大. 一:不在同一层级,可以用[./..] ...

  10. 【Python全栈-后端开发】MySQL数据库-练习题

    MySQL数据库-练习题 一.表关系 请创建如下表,并创建相关约束 二.操作表 1.自行创建测试数据 2.查询“生物”课程比“物理”课程成绩高的所有学生的学号: 3.查询平均成绩大于60分的同学的学号 ...