[Java in NetBeans] Lesson 12. Arrays
这个课程的参考视频和图片来自youtube。
主要学到的知识点有:
1. Array: container that holds a fixed number of values of the same type, can be access by index.
- Create a string array and initialize the elements one by one. Index will be start from 0 to size -1.
String[] names = new String[3];
names[0] = "Tom";
names[1] = "Bob";
names[2] = "Joe";
// Below is a wrong comment
names[3] = "wrong!" // Will show error because out of the index.
- Automatic detect the size of the array
String[] names = new String[]{"Tom", "Bob", "Joe"};
2. Go through the elements in the array.
- for loop using index
for ( int i = 0; i < names.length; i ++){
System.out.printf("%s ", names[i]);
}
// the result will be like this
Tom, Bob, Joe
- for loop using "foreach"
for ( String each : names){
System.out.printf("%s ", each);
}
// the result will be like this
Tom, Bob, Joe
[Java in NetBeans] Lesson 12. Arrays的更多相关文章
- [Java in NetBeans] Lesson 13. Multidimensional Arrays
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. Multidimensional Array: Array that has more than one dimension. ...
- [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 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 16. Exceptions.
这个课程的参考视频和图片来自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 ...
- [Java in NetBeans] Lesson 05. Method/function
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Define a method:(motivation: write one time, but use it many times ...
随机推荐
- Python与金融量化分析----金融与量化投资
一:金融了解 金融:就是对现有资源进行重新的整合之后,进行价值和利润的等效流通. 金融工具: 股票 期货 黄金 外汇 基金 ............. 股票: 股票是股份公司发给出资人多的一种凭证,股 ...
- Linux 创建文件系统及挂载文件系统流程详解(转)
作者:北南南北 来自: LinuxSir.Org 摘要:本文对新增硬盘,切割硬盘,创建硬盘分区,为硬盘分区创建文件系统,以及加载文件系统的流程做总结性论述:主要是为初学者弄清楚这一操作过程:本文涉及f ...
- MFC实现一元稀疏多项式运算器
MFC实现一元稀疏多项式运算器 基本要求 输入并建立两个多项式 多项式a与b相加,建立和多项式c 多项式a与b相减,建立差多项式d 输出多项式a, b, c, d.输出格式:比如多项式a为:A(x)= ...
- POJ 2449 - Remmarguts' Date - [第k短路模板题][优先队列BFS]
题目链接:http://poj.org/problem?id=2449 Time Limit: 4000MS Memory Limit: 65536K Description "Good m ...
- [No0000182]Parallel Programming with .NET-Partitioning in PLINQ
Every PLINQ query that can be parallelized starts with the same step: partitioning. Some queries ma ...
- shell脚本的基本结构以及如何执行
1.shell脚本通常以.sh为后缀,不是说不带这个.sh脚本就不会执行,而是大家一种通用的命名规范而已 2.shell脚本中的第一行一定是:#! /bin/bash.该命令说明,该文件使用的是bas ...
- JavaScript面向对象之函数构造器的理解
1,在使用函数创建类时,函数本身也被称为该类的构造器,该类的构造器方法,该类的构造方法,该类的构造函数等等. 2,注意构造器方法是没有返回值的,当创建该类的实例时,必须调用该类的构造方法. 3,获取构 ...
- kubernetes的apiserver
1. API Server简介 k8s API Server提供了k8s各类资源对象(pod,RC,Service等)的增删改查及watch等HTTP Rest接口,是整个系统的数据总线和数据中心. ...
- liteide 去除go程序cmd窗口
http://blog.csdn.net/aqtata/article/details/53389261
- 那些年读过的书《Java并发编程实战》二、如何设计线程安全类
1.设计线程安全类的过程 设计线程安全类的过程就是设计对象状态并发访问下线程间的协同机制(在不破坏对象状态变量的不变性条件的前提下). (1)构建线程安全类的三个基本要素: 1)找出构成对象状态的所有 ...