[Java in NetBeans] Lesson 14. ArrayList and Collections
这个课程的参考视频和图片来自youtube。
主要学到的知识点有:
1. Collection: container that contians objects.
2. Difference between Collection and Array
| collection | array | example |
| Dynamic siized | fixed sized | int[] grades = new int[20] |
| cannot | Primitive types | ArrayList<integer> grades = new ArrayList<>(); |
note: int => Integer
double => Double
3. ArrayList: an implemnetation of a collection.
- Create a ArrayList. (assume that we have a Card class has number and suit)
ArrayList<Card> cards = new ArrayList<>():
- Add element in the ArrayList
cards.add(new Card(8, Diamond));
cards.add(new Card(6, Diamond));
- Remove element in the ArrayList
Card temp = cards.remove(); // will move the first elemnt in the ArrayList
- Set element in the ArrayList
cards.set(, new Card(, Diamond)); // will set the first elemnt in the ArrayList
- Get element in the ArrayList
cards.get(); // will get the first elemnt in the ArrayList
- Insert element in the ArrayList
cards.add(, new Card(, Diamond)); // will add Diamond 1 at the first elemnt in the ArrayList
[Java in NetBeans] Lesson 14. ArrayList and Collections的更多相关文章
- [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 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 16. Exceptions.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: We want to handle the bad Error. (e.g bad input / bugs in program) ...
- [Java in NetBeans] Lesson 10. For Loops
这个课程的参考视频和图片来自youtube. 主要学到的知识点有:(the same use in C/C++) 1. x++, x += 1; similar x--, x -= 1; x *= 2 ...
- [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 ...
随机推荐
- 【2017.12.12】deepin安装U盘制作,支持 BIOS+UEFI,deepin_Recovery+Win PE
U盘要求为 FAT32,MBR分区表 如果需要放 4GB 大文件,可以分两个分区,第一分区FAT32格式,放启动相关文件,第二个分区用 NTFS 格式,放其它资料. 最新 Win10 支持显示 U盘 ...
- freemarker 中可以直接使用的内置对象
freemarker 中可以直接使用的内置对象 需要配置一下:springboot中配置 ## Freemarker \u914D\u7F6E ## \u6587\u4EF6\u914D\u7F6E\ ...
- Thrift的一些概念
Thrift最初是由Facebook开发的,因为随着流量和网络结构的扩展,一些操作如搜索.分发.事件日志记录等已经超出系统的处理范围,所以Facebook的工程师开发服务时选择了多种不同的编程语言来达 ...
- jquery <img> 图片懒加载 和 标签如果没有加载出图片或没有图片,就显示默认的图片
参考链接:http://www.jq22.com/jquery-info390 或压缩包下载地址:链接:http://pan.baidu.com/s/1hsj8ZWw 密码:4a7s 下面是没有 ...
- AJAX里使用的弹窗样式 tanchuang.js tanchuang.css
tanchuang.js // 每个弹窗的标识 var x =0; var idzt = new Array(); var Window = function(config){ //ID不重复 idz ...
- 单链表实现n(n≥20)的阶乘
n(n≥20)的阶乘 基本要求 数据的表示和存储: 累积运算的中间结果和最终的计算结果的数据类型要求是整型--这是问题本身的要求. 试设计合适的存储结构,要求每个元素或结点最多存储数据的3位数值. 数 ...
- 短信文本pdu模式解析
来源于互联网 年代较长 如有侵犯 请联系删除 text模式主要发送字符集(有限的),不能用来发送中文,但是hex moder可以发送所有字符. pdu moder被所有手机支持,主要分为7bit 8b ...
- ThinkPHP最简教程
这里不讲原理,只讲操作. 这里不说MVC,只说目录(文件夹)结构. 假设Apache Http Server.PHP.MySql都已经安装完毕并已配置完毕,能够输出phpinfo(). 框架是什么? ...
- babel-preset-env使用介绍
声明:文章转自https://www.cnblogs.com/ye-hcj/p/7070084.html 本文介绍一个babel转码神器babel-preset-env 简介 现如今不同的浏览器和平台 ...
- 几个linux内核参数
raid=noautodetec libata.force=3.0G mem=1G 不检测raid, sata限制3.0G 内存限制1G https://serverfault.com/questio ...