这个课程的参考视频和图片来自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. python 中面向对象的概念

    原文 域和作用空间 本地域,函数域(nonlocal)和 全局域(global) def scope_test(): def do_local(): spam = "local spam&q ...

  2. spark - Locality Level

    这几个值在图中代表 task 的计算节点和 task 的输入数据的节点位置关系 PROCESS_LOCAL: 数据在同一个 JVM 中,即同一个 executor 上.这是最佳数据 locality. ...

  3. scala 可变集合与内存清理的关系

    留坑待填 使用scala.collection.mutable._期间,发现了当程序运行内存开销较多时,使用系统工具进行内存清理,然后程序报出了变量找不到.内存无法访问.数组访问越界,堆栈溢出等多种错 ...

  4. Echarts Map 值域为小数的原因

    最近做一个项目用到了Echarts Map不知道怎么回事,有时多了一位小时,可这个意义不用小数表示(1.0个人似乎觉得有点奇怪嘞 {boolean}calculable false 是否启用值域漫游, ...

  5. [No0000DA]WPF ControlTemplate简介

    一.简介 WPF包含数据模板和控件模板,其中控件模板又包括ControlTemplate和ItemsPanelTemplate,这里讨论一下ControlTemplate.其实WPF的每一个控件都有一 ...

  6. 在ubuntu系统中,python依赖存放的路径

    你在使用python,之后你想给python安装一些第三方库,如tensorflow或者tensorrt,那么这些包存放在哪个路径下呢? 该目录下: /usr/local/lib/python3.5/ ...

  7. 配置llama实现impala on yarn-验证未通过,仅以此文作为参考

    以下内容采自网络,目前验证未通过,仅以此作为参考: 简介:早期的Impala版本中,为了使用Impala,我们通常会在以Client/Server的结构在各个集群节点启动impala-server.i ...

  8. i-chips融合芯片分析

    适合做图像变形和融合 http://www.i-chips.co.jp/products/ma_non-deployment/c786.html 下面视频其实用了2个芯片,其中IP00C733用原始信 ...

  9. 转:Spring与Mybatis整合的MapperScannerConfigurer处理过程源码分析

    原文地址:Spring与Mybatis整合的MapperScannerConfigurer处理过程源码分析 前言 本文将分析mybatis与spring整合的MapperScannerConfigur ...

  10. 抽屉之Tornado实战(6)--session工厂(工厂方法模式)

    我之前写的session一般保存在服务器的内存里,那可以保存在缓存,或是数据库,那问题来了,不同地方,保存方式是不同的,所以需要定义不同的类,cache/redis/memcached类 sessio ...