[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 ...
随机推荐
- SPL标准库-数据结构
数据结构:栈 );] = ;] = ;var_dump($array); 来自为知笔记(Wiz)
- Python3中StringIO
关于调用StringIO模块,python3中需要这样: from io import StringIO 而python2还是 from StringIO import StringIO
- STL的基本介绍
STL是标准模板库,现在是c++的一部分 STL被组织为下面的17个头文件:<algorithm>.<deque>.<functional>.<iterato ...
- vsftpd上传文件出现553 Could not create file错误解决方法
1.确定目录权限 2.关闭selinux
- 确界原理 supremum and infimum principle 戴德金定理 Dedekind theorem
确界原理 supremum and infimum principle 戴德金定理 Dedekind theorem http://www.math.ubc.ca/~cass/courses/m ...
- dyld环境变量
苹果APP启动,分为两个过程:系统dylib动态链接库 app的main函数启动过程. main函数过程直接对iOS开发者.这里备忘的dylib过程: 一.dyld加载到虚拟内存 1. loa ...
- 转:Redis 3.2.1集群搭建
Redis 3.2.1集群搭建 一.概述 Redis3.0版本之后支持Cluster. 1.1.redis cluster的现状 目前redis支持的cluster特性: 1):节点自动发现 2) ...
- oracle partition table 分区表详解
Oracle partition table 分区表详解 分区表就是通过使用分区技术,将一张大表,拆分成多个表分区(独立的segment),从而提升数据访问的性能,以及日常的可维护性.分区表中,每个分 ...
- Java之旅_高级教程_Java Mysql连接(1)
工具:Eclipse .mysql5.7 MySQL连接驱动:mysql-connector-java-5.1.27.jar 获取地址:https://dev.mysql.com/downloa ...
- 【Python基础】json.dumps()和json.loads()、json.dump()和json.load()的区分
json文件处理涉及的四个函数json.dumps()和json.loads().json.dump()和json.load()的区分 一.概念理解 1.json.dumps()和json.loads ...