Collection 接口是 Java 集合框架的根接口。Jdk 没有类直接继承这个j接口,而是继承它的子借口,比如 List, Set, Queue.
主要方法:
1. 添加元素: add, addAll.
2. 删除元素: clear, remove, removeAll, removeIf, retainAll.
3. 获取 size :isEmpty, size.
4. 转换成 stream: stream, parallelStream.
5. 转换成数组: toArray.
参考链接:
1. https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html