[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 ...
随机推荐
- day10 多媒体(文字 图片 音频 视频)
1计算机表示图形的几种方式 bmp:以高质量保存 用于计算机 jpg:以良好的质量保存 用于计算机或者网络 png:以高质量保存 图片大小的计算公式:图片 ...
- Web(二)
一.数据的传递--转发和重定向 1.创建一个login.jsp页面 <body> <%-- action:我们需要提交的地址 method:请求的方式 --%> ...
- go 的文件处理
准备一个文件 imooc.txt hello world! 一.使用 io/ioutil 包 定义一个 check 函数 func check(err error) { if err != nil { ...
- ABP之事件总线(1)
什么是事件总线呢?官方的文档说,它是一个单例对象,由其他的类共同拥有,可以用来触发和处理事件.这个东西确实比较陌生,为什么要使用事件总线,或者说事件总线的优势是什么???首先我们可以明确的是,事件总线 ...
- 词云绘制wordcloud
wordcloud是优秀的第三方词云展示库,该库以空格为分割线,按照单词出现的频率自动设置字号与颜色实例如下 import wordcloud#词云库 import jieba#分词库 a=open( ...
- 用em包图片记
像这种很常见的字体旁边带图标的,很多都是用em的background去实现. <li><em class="wx"></em><a hre ...
- FFmpeg制作+x264+faac
https://blog.csdn.net/leixiaohua1020/article/details/47071547 雷神的博客 https://www.jianshu.com/p/3f023 ...
- wpf之WrapPanel与StackPanel
WrapPanel: WrapPanel布局面板将各个控件从左至右按照行或列的顺序罗列,当长度或高度不够是就会自动调整进行换行.他有三个属性 Orientation——根据内容自动换行,ItemHei ...
- [未解决:快速滑动collectionveiw请求数据崩溃]:unable to allocate 6553600 bytes for bitmap data
崩溃:unable to allocate 6553600 bytes for bitmap data
- Beanstalkd 基本概念和使用
1:什么是 Beanstalkd ? Beanstalkd 一个高性能.轻量级的分布式内存队列系统 简单来说,就是一个队列,相比于 数据库/redis 队列相比. 更专业.能完成的功能更多.就这么理解 ...