type
status
date
slug
summary
tags
category
icon
password
一、Collection
1.集合框架图


2.Collection的方法
int size();
boolean isEmpty();
boolean contains(Object o);
boolean add(E e);
boolean remove(Object o);
boolean containsAll(Collection<?> c);
boolean addAll(Collection<? extends E> c);
boolean removeAll(Collection<?> c);
void clear();
3.集合的遍历
3.1 Iterator
3.2增强for循环
for(遍历对象的类型 遍历变量:要遍历集合的名称)
增强for循环的底层仍然是Iterator迭代器
二、List
List接口实现的方法,存取是有序且可重复的!
1、list的方法
2、List的遍历
3、List的注意事项
1.list的底层用数组实现
2.ArrayList是线程不安全的
3.List可以加入null值
4、List源码
- Author:Blinky
- URL:http://preview.tangly1024.com/article/1ce1c0db-37a0-805e-b625-d16452135e0c
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!