当前位置:网站首页>2.Collection interface
2.Collection interface
2022-08-09 09:33:00 【come here my bear】
Java Collection Interface
Collection System Collection
graph TD;Interface.Collection-->Interface.ListInterface.Collection-->Interface.SetInterface.List-->Class.ArrayListInterface.List-->Class.LinkedListInterface.List-->Class.VectorInterface.Set-->Class.HashSetInterface.Set-->Interface.SortedSetInterface.SortedSet-->Class.TreeSetInterface (interface), Class (implementation class)
The root interface of the architecture, representing a set of objects, called a "collection"(Interface.Collection)
Characteristics of the List interface: ordered, subscripted, and repeatable elements
Characteristics of the Set interface: unordered, no subscripts, and elements cannot be repeated
Collection parent interface
Features: Represents a set of objects of any type, unordered, unsubscripted, and cannot be repeated
Method:
- boolean add(Object obj) add an object
- boolean addAll(Collection c) adds all objects in a collection to this collection
- void clear() clears all objects in this collection
- boolean contains(Object o) Check if this collection contains o object
- boolean equals(Object o) Compares this collection for equality with the specified object
- boolean isEmpty() Check if this collection is empty
- boolean remove(Object o) removes the o object from this collection
- int size() returns the number of elements in this collection
- Object[] toArray() converts this collection to an array
- iterator() returns an iterator over the elements of this collection
- hasNext() determines whether there is the next element and returns a boolean value
- next() gets the next element
- remove() removes the current element
- Cannot use the collecton method at the same time ConcurrentModificationException concurrent modification exception
边栏推荐
猜你喜欢

Understanding of PID control motor output as motor PWM duty cycle input

本体开发日记02-sparql简单查询

游戏测试的概念是什么?测试方法和流程有哪些?

Ontology development diary 04 - to try to understand some aspects of protege
选择黑盒测试用例设计方法的综合策略方案总结

有返回值的函数
软件测试外包公司怎么样?有什么好处和坏处?为什么没人去?
测试计划包括哪些内容?目的和意义是什么?
银联最新测试工程师笔试题目,你能得多少分?

STM32F103实现IAP在线升级应用程序
随机推荐
Ontology development diary 02 - simple sparql query
常用功能测试的检查点与用例设计思路
【个人学习总结】CRC校验原理及实现
Golang Protobuf 处理
第三方免费开放API 获取用户IP 并查询其地理位置
全网最全的软件测试基础知识整理(新手入门必学)
Onnx - environment build 】 【 tensorrt
7.FileFilter interface
vgg网络结构
5.Set接口与实现类
本体开发日记05-努力理解SWRL(下)
3. Practice the Thread
本体开发日记02-sparql简单查询
Ontology Development Diary 03 - When debugging is in progress
本体开发日记04-努力理解protege的某个方面
归并排序
Another implementation of lateral view explode
GBase数据库产生迁移工具假死的原因是什么?
接口开发规范及测试工具的使用
接口测试的概念、目的、流程、测试方法有哪些?