这个课程的参考视频和图片来自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. A - River Hopscotch

    Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully ...

  2. mongodb三种存储引擎高并发更新性能专题测试

    背景说明 近期北京理财频道反馈用来存放股市实时数据的MongoDB数据库写响应请求很慢,难以跟上业务写入速度水平.我们分析了线上现场的情况,发现去年升级到SSD磁盘后,数据持久化的磁盘IO开销已经不是 ...

  3. ConcurrentLinkedQueue since java1.5

    1 父类 java.lang.Object 继承者 java.util.AbstractCollection<E> 继承者 java.util.AbstractQueue<E> ...

  4. db2 查询表前几行

    不需要那么多不需要那么多数据的时候使用fetch first xxx rows only数据的时候使用fetch first xxx rows only

  5. WebLogic初学笔记

    这两天在公司自己摸索着用WebLogic(因为可以问的同事不多),之前一直用的是tomcat.面对一个从不了解的技术,自己摸索似乎非常背劲.后来有同事指点果然事半功倍. 项目使用WebLogic版本: ...

  6. python web篇 创建数据库

    python3 manage.py migrate ls sqlite3 使用单文件数据库,管理方便 运行测试 python manage.py runserver 输入http://127.0.0. ...

  7. [No0000F4]C# 枚举(Enum)

    枚举是一组命名整型常量.枚举类型是使用 enum 关键字声明的. C# 枚举是值数据类型.换句话说,枚举包含自己的值,且不能继承或传递继承. 声明 enum 变量 声明枚举的一般语法: enum &l ...

  8. javascript中的数字玩法,颠覆你的眼睛

    1.JavaScript中的数字中有一些很奇葩的现象. 在Chrome控制台中可以自己做一下实验: 1 === 1.0 ; //true 习惯了强类型语言,如java,c,OC看到这个结论还是有点小迷 ...

  9. transformations 变换集合关系 仿射变换

    http://groups.csail.mit.edu/graphics/classes/6.837/F03/lectures/04_transformations.ppt https://group ...

  10. Appium入门(9)—— Appium API

    摘自:http://www.testclass.net/appium/appium-base-api-01/ 1.安装: installApp() driver.installApp("d: ...