[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 ...
随机推荐
- 网络推送通知:及时,相关和准确 (navigator.serviceWorker.register(), window.PushManager, new Notification)
google网络推送通知 https://developers.google.cn/web/fundamentals/push-notifications/ 服务工作线程:简介server worle ...
- java封装实现Excel建表读写操作
对 Excel 进行读写操作是生产环境下常见的业务,网上搜索的实现方式都是基于POI和JXL第三方框架,但都不是很全面.小编由于这两天刚好需要用到,于是就参考手写了一个封装操作工具,基本涵盖了Exce ...
- Flask web开发之路十一
首先写一下cookie和session的概念,然后是Flask中session的工作机制以及操作session ### cookie: 1. `cookie`出现的原因:在网站中,http请求是无状态 ...
- 无法在Web服务器上启动调试。
Ⅰ x 操作超时 有关详细信息,请单击"帮助" x IIS--应用程序池--找到用到的程序池--回收 2 报这个错误的时候,我的IIS应用程序池只有一个>>> ...
- static的含义
static的含义:(1)设置变量的存储域,函数体内static变量的作用范围为该函数体,不同于auto变量,该变量的内存只被分配一次,因此其值在下次调用时仍持上次的值:(2)限制变量的作用域,在模块 ...
- 转:ActiveMQ的作用总结(应用场景及优势)
原文地址: ActiveMQ的作用总结(应用场景及优势) 业务场景说明: 消息队列在大型电子商务类网站,如京东.淘宝.去哪儿等网站有着深入的应用, 队列的主要作用是消除高并发访问高峰,加快网站的响应速 ...
- 《Redis 垃圾回收》
推荐一首歌 - <纸短情长> 花粥 很好听 一:redis的垃圾回收 - 为了可以使用更多的内存,redis有一套自己的键值淘汰机制. - 修改 maxmemory参数,限制Redis使用 ...
- idea+maven+springboot+mybatis+springmvc+shiro
springboot就是把创建项目简单化,省去了以往的配置mybatis.springmvc的繁琐过程. 搭建web应用三个主要功能,请求和响应,数据库交互,权限配置. 一.idea创建项目 (1) ...
- Spring 配置文件出现异常!
spring配置文件错误 Referenced file contains errors (http://www.springframework.org/schema/beans/spring-bea ...
- MySQL模拟Oralce闪回操作
在前面的文章中我们介绍了MySQL误操作后数据恢复(update,delete忘加where条件),大概操作是通过sed命令把binlog中相关SQL误操作给逆向回来,然后导入SQL文件来恢复错误操作 ...