当前位置:网站首页>Set common methods
Set common methods
2022-06-12 05:00:00 【なんでもないゃ】
aggregate :
Collection Common methods in :
boolean add(E e); Add objects to the collection ;
boolean addAll(Collection<? extends E> c); Assign parameters to a collection c Add all elements in to the current collection ;
boolean contains(Object o); Determine whether the specified object is included ;
boolean containsAll(Collection<?> c); Determines whether all objects specified by the parameter are included ;
boolean retainAll(Collection<?> c); Keep all objects that exist in the current set and in the parameter set ;
boolean remove(Object o); Remove objects from the collection ;
boolean removeAll(Collection<?> c); Deletes all objects specified by the parameter from the collection ;
void clear(); Empty the set ;
int size(); Returns the number of containing objects ;
boolean isEmpty(); Determine whether it is null ;
boolean equals(Object o) Judge whether it is equal ;
int hashCode() Get the hash code value of the current collection ;
Object[] toArray() Convert collection to array ;
Iterator<E> iterator() Gets the iterator of the current collection ;
Shortcut key : stay idea Press and hold Ctrl Point method , Jump to the specific content of the method ;Ctrl+n Search and open the source code of the class directly ;Ctrl+F12 Search and open the source code of the method ;
java.util.Iterator Interface : Used to describe iterator objects , Traversable Collection All elements in the collection , yes Collection Interface's parent class ;
Common methods :
boolean hasNext() Determine whether there are elements in the set that can be iterated ;
E next() Used to take out one element and point to the next element ;
void remove() Delete the last element accessed ;
abnormal :
foreach loop :for( Element type Variable name : Array / Collection name ){ The loop body ;}, This method is a simplified version of the iterator ;
边栏推荐
- 【C语言】实现字符串截取功能
- [backtracking method] queen n problem
- 加速训练之并行化 tf.data.Dataset 生成器
- Asp. Net core EF value conversion
- Design of a simple embedded web service application
- Introduction to MMS memory optimization of Hisilicon MPP service
- Why is Julia so popular?
- Redis learning notes (continuously updating)
- Surface net radiation flux data, solar radiation data, rainfall data, air temperature data, sunshine duration, water vapor pressure distribution, wind speed and direction data, surface temperature
- When the build When gradle does not load the dependencies, and you need to add a download path in libraries, the path in gradle is not a direct downloadable path
猜你喜欢
![[GIS tutorial] land use transfer matrix](/img/89/c5b55262e39405547c46538355e278.jpg)
[GIS tutorial] land use transfer matrix

Ubunt 20.04 uses CDROM or ISO as the installation source

asp. Net core theme Middleware

L1-066 cat is liquid (5 points)

Gao Xiang slam14 notes on three Lie groups and Lie algebra

Transpiration and evapotranspiration (ET) data, potential evapotranspiration, actual evapotranspiration data, temperature data, rainfall data

L1-067 Roche limit (10 points)

Install pycharm under Kali and create a shortcut access

Yolo opencv scale identification scale reading identification water gauge identification water level identification source code

Interview must ask: summary of ten classic sorting algorithms
随机推荐
2022 electrician (elementary) operation certificate examination question bank and online simulation examination
kali_ Nat mode, bridging Internet / host only_ detailed
Install pycharm under Kali and create a shortcut access
kali_ Change_ Domestic source
SQL注入上传一句话木马(转)
Applet pull-down load refresh onreachbottom
One dragon and one knight accompanying programmers are 36 years old
CCF access control system
What is reverse repurchase of treasury bonds? Is the reverse repurchase of treasury bonds safe?
Why is Julia so popular?
leetcode 263. Ugly number
one billion one hundred and eleven million one hundred and eleven thousand one hundred and eleven
How to deploy dolphin scheduler 1.3.1 on cdh5
cellular automaton
4.3 模拟浏览器操作和页面等待(显示等待和隐式等待、句柄)
JS how to get the date
22-2-28 there are many things to do at work today, ETH analysis
Rv1109 lvgl UI development
Some problems of Qinglong panel
JWT学习与使用