当前位置:网站首页>Set<String>
Set<String>
2022-06-28 08:17:00 【wy_ forty-three million four hundred and thirty-one thousand ei】
HashSet
It has several characteristics , First, it doesn't have duplicate elements , Secondly, it is disordered , In addition, it can contain empty elements .
Set<String> str = new HashSet<String>();
str.add("first");// Additive elements
str.add("second");
str.remove("first");// Remove elements
// Traverse , By iterator
Iterator<String> it = str.iterator();
TreeSet
First of all, it can not write the same data , Second, you cannot write null data , The last data written is ordered
Set<String> str = new TreeSet<String>();
str.add("first");// Additive elements
str.add("second");
str.add("third");
// Traverse , By iterator
Iterator<String> it = str.iterator();
边栏推荐
猜你喜欢
图像翻译/Transformer:ITTR: Unpaired Image-to-Image Translation with Transformers用Transfor进行非配对图像对图像的转换
Uvcgan: unt vision transformer cycle-consistent Gan for unpropared image-to-image translation
B_QuRT_User_Guide(27)
Jenkins' common build trigger and hook services (V)
你了解TCP协议吗(一)?
SLAM中常用的雅克比矩阵J
Discussion on the application of GIS 3D system in mining industry
AI首席架构师8-AICA-高翔 《深入理解和实践飞桨2.0》
Installing mysql5.7 under Windows
Little artist huangxinyang was invited to participate in the Wuhan station of children's unit of Paris Fashion Week
随机推荐
LeetCode之三步问题
SQL analysis (query interception analysis for SQL optimization)
B_QuRT_User_Guide(27)
Study notes 22/1/17
Ambari (VIII) --- ambari integrated impala document (valid for personal test)
Prometheus monitoring (I)
探讨gis三维系统在矿山行业中的应用
PMP从报考到拿证基本操作,了解PMP必看篇
Study notes 22/1/11
Airflow2.x distributed deployment DAG execution failure log cannot be obtained normally
Redis master-slave structure and application scenarios
SQL master-slave replication setup
About ASM disk space full, clean up ASM disk
11grac turn off archive log
AI chief architect 8-aica-gao Xiang, in-depth understanding and practice of propeller 2.0
Installing MySQL under Linux
Installing mysql5.7 under Windows
块级元素上下左右居中的两个小技巧
Generation and verification of JWT token
NPM clean cache