当前位置:网站首页>[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]
}
}边栏推荐
- New window open page -window open
- Werewolf killing strategy: do you think I'm easy to cheat? Who do we believe!
- 【let var const】
- 产品模块化设计的前世今生
- GC garbage collection
- 自定义插入页面标签以及实现类似通讯录的首字母搜索
- Salesmartly has some tricks for Facebook chat!
- Uni app wechat applet one click login to obtain permission function
- 通过js实现金字塔(星号金字塔,回文对称数字金字塔)
- MySQL reports an error can't create table 'demo01 tb_ Student‘ (errno: 150)*
猜你喜欢

类加载机制
Use the uni app demo provided by Huanxin to quickly realize one-on-one chat

正则表达式=Regex=regular expression
![[Mori city] random talk on GIS data (I)](/img/4d/1ed4bbf397b8d756c91241705528de.jpg)
[Mori city] random talk on GIS data (I)

如何正确使用Vertx操作Redis(3.9.4带源码分析)

对象的创建

Introduction and installation of crunch, and making password dictionary with crunch

DTD modeling

AAAI2020: Real-time Scene Text Detection with Differentiable Binarization

Intensive cultivation of channels for joint development Fuxin and Weishi Jiajie held a new product training conference
随机推荐
HLS4ML/vivado HLS 报错解决方案
JS ternary expression complex condition judgment
Remove line breaks from MySQL query results
Analysis of GetMessage underlying mechanism
Live HLS protocol
CMU AI PhD first year summary
Redo和Undo的区别
A brief understanding of white box encryption technology
CMU AI PhD 第一年总结
New window open page -window open
GB28181的NAT穿透
【无标题】
Salesmartly has some tricks for Facebook chat!
通过js实现金字塔(星号金字塔,回文对称数字金字塔)
Basic use of MySQL
Ffmpeg common commands (2)
Oracle物理体系结构
Anaconda安装虚拟环境到指定路径
Botu V16 obtains the system time and converts it into a string
js三元表达式复杂条件判断