[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 ...
随机推荐
- DOM内容操作
<table border="2"> <thead id="1" class="c1 c2"> <tr> ...
- 【vue】如何在 Vue-cli 创建的项目中引入 iView
根据vue项目的搭建教程,以下记录如何在Vue-cli创建的项目中引入iView. 1)iView的安装,在项目下使用 npm 安装iView cnpm install iview --save ...
- 项目启动报错java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
项目已启动的情况下,MyEclipse异常退出.再次打开后重启项目,项目报错:java.net.SocketException: Unrecognized Windows Sockets error: ...
- java小tip
//20181128 ·javaJDK源码在c盘java安装目录里jdk文件夹src.zip压缩包里 ·HashCode()返回的数可能是负数 ·内部类的优点:可以方便调用所在类的方法 ·接口中定义常 ...
- 关于FlexSlider插件
Flexslider选项设置 $(window).load(function() { $('.flexslider').flexslider({ animation: "fade" ...
- node 下查看安装插件的最新版本号的方法
例如查看extract-text-webpack-plugin的最新版本号 (不一定时本地安装的插件的版本号) npm view extract-text-webpack-plugin version ...
- CSP 通信顺序进程
communicating sequential processes CSP 通信顺序进程 C.A.R.Hoare 1979 CSP是一种用来描述并行系统交互模式的形式语言,最早由C.A.R.Hoar ...
- Chap5:操作文件和目录[The Linux Command Line]
Wildcards Wildcard Meaning * Matches any characters ? Matches any single character [characters] Matc ...
- [development][tcp/ip][ids] 一个简单有参考价值的库 libnids
libhtp 中的例子, 可以通过libnids快速使用. 或者可以快速的写个sniffer. 支持三个功能 ip分片重组, tcp乱序重排, 端口扫描发现. 工程: https://github.c ...
- delphi连接mysql (通过libmysql.dll连接)
首先在窗体上拖拽sqlconnection和sqlquery两个控件: 然后在测试连接中,写入以下代码(注意exe生成目录下需要有dbxopenmysql50.dll和libmysql.dll) SQ ...