当前位置:网站首页>[exercise] HashSet
[exercise] HashSet
2022-07-01 19:43:00 【aigo-2021】
distinguish :
import java.util.HashSet;
public class TestHashSet {
public static void main(String[] args) {
HashSet set=new HashSet();
set.add(1); // In this case, the length is :1 The content is :1
set.add(new Integer(1)); // In this case, the length is :1 1
set.add(new Integer("1")); // In this case, the length is :1 1
set.add(new Integer('1')); // In this case, the length is :2 49
set.add("1"); // In this case, the length is :3 1
set.add('1'); // In this case, the length is :4 1
set.add(new String("1")); // In this case, the length is :4 1 new String It's redundant
System.out.println(set.size()); //4
System.out.println(set); //[1, 49, 1, 1]
}
}
边栏推荐
- MySQL signale une erreur can 't create table' demo01. TB Étudiant '(errno: 150)
- SQL 入门计划-1-选择
- 科技T3国产平台!成功搭载“翼辉国产实时系统SylixOS”
- Basic knowledge of audio coding and decoding
- Nat penetration of gb28181
- Analysis of GetMessage underlying mechanism
- Summary of SQL query de duplication statistics methods
- Ffmpeg error code
- 703. The k-th element in the data flow
- Opencv video quality diagnosis - VIDEO occlusion diagnosis
猜你喜欢
随机推荐
2022/6/8-2022/6/12
Compile ffmpeg source code with msys+vs2019 under win10
MySQl的基本使用
Using win7 vulnerability to crack the system login password
JS ternary expression complex condition judgment
1592 例题1 国王(Sgu223 LOJ10170 LUOGU1896 提高+/省选-) 暴力思考 状压DP 01背包
Uni app wechat applet one click login to obtain permission function
MySQL reports an error can't create table 'demo01 tb_ Student‘ (errno: 150)*
AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
ddr4测试-2
Botu V16 obtains the system time and converts it into a string
Instagram 为何从内容共享平台变成营销工具?独立站卖家如何利用该工具?
H264编码profile & level控制
CMU AI PhD first year summary
【无标题】
Axure does not display catalogs
直播HLS协议
Uni app product classification
测试自学人必看:软件测试如何找测试项目?
torch. nn. functional. Interpolate function