[Java in NetBeans] Lesson 10. For Loops
这个课程的参考视频和图片来自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的更多相关文章
- [Java in NetBeans] Lesson 11. While Loops
这个课程的参考视频和图片来自youtube. 主要学到的知识点有:(the same use in C/C++) 1. while loop while(i < max){} will keep ...
- [Java in NetBeans] Lesson 16. Exceptions.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) ...
- [Java in NetBeans] Lesson 07. JavaDoc and Unit Tests
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. organize code into packages Create a package if want to make th ...
- [Java in NetBeans] Lesson 04. Class / Objects
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Class: Blueprint for an object. (e.g. dog is a class) Object: cust ...
- [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 ...
- [Java in NetBeans] Lesson 17. File Input/Output.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) ...
- [Java in NetBeans] Lesson 15. Sorting and Searching.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Build in functions in java.util.Collections Need to implement a co ...
- [Java in NetBeans] Lesson 09. Switch / If-Else Ladder
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. Nested If-else statement (if-else ladder) /** * 90 and above == ...
- [Java in NetBeans] Lesson 06. Custom classes
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Constructors: A special method called when an object of the class ...
随机推荐
- Javascrit 总结
1. 数组三种表达方法 第一种 var arr = new Array(1,2,3); document.writeln(arr+"<br/>"); 第二种 var a ...
- 使用【 ajax 】【 bootstrap 】显示出小窗口 详情内容 一些代码意思可以参考下一个文章
使用[ bootstrap ]显示出小窗口 详情内容 显示页面 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// ...
- 关于html中input组件间空隙的去除
有空隙的时候的代码是这样的: <input type="text" name="search" title="请输入要搜索的内容" s ...
- POJ 1655 - Balancing Act - [DFS][树的重心]
链接:http://poj.org/problem?id=1655 Time Limit: 1000MS Memory Limit: 65536K Description Consider a tre ...
- 【每日一题】 UVA - 1599 Ideal Path 字典序最短路
题解:给一个1e5个点2e5条边,每个边有一个值,让你输出一条从1到n边的路径使得:条数最短的前提下字典序最小. 题解:bfs一次找最短路(因为权值都是1,不用dijkstra),再bfs一次存一下路 ...
- hive桶表好处
对于每一个表(table)或者分区, Hive可以进一步组织成桶,也就是说桶是更为细粒度的数据范围划分.Hive也是针对某一列进行桶的组织.Hive采用对列值哈希,然后除以桶的个数求余的方式决定该条记 ...
- C和C指针小记(十)-函数
1.函数的定义 函数的定义就是函数体的实现. 语法: 类型 函数名(形式参数) 代码块 函数返回类型和函数名分开写是代码风格的问题,现代语言如swift返回值在函数名和参数表的后面,这样使得某些工程工 ...
- HDMI 接口及CEC信号
HDMI 接口及CEC信号 2016年12月02日 14:16:38 King-Five 阅读数:16389 HDMI接口 HDMI(High Definition Multimedia Interf ...
- [ovs] openvswitch 入门
https://www.sdnlab.com/sdn-guide/14747.html http://sdnhub.cn/index.php/openv-switch-full-guide/ http ...
- [administrative][archlinux][netctl][wpa_supplicant] 查看WIFI链接信息
当使用 netctl + wpa_supplicant的时候,环境里同时存在好多个WIFI,而我同时有配置了他们的密钥信息在配置文件中. 那么我该如何查看,我当前链接到了哪个WIFI上? /home/ ...