当前位置:网站首页>[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]
}
}
边栏推荐
猜你喜欢
SIP protocol of gb28181
DDR4 test-2
HLS4ML报错The board_part definition was not found for tul.com.tw:pynq-z2:part0:1.0.
P2433 【深基1-2】小学数学 N 合一
Facebook聊单,SaleSmartly有妙招!
Solution and summary of Nacos startup failure
通过js实现金字塔(星号金字塔,回文对称数字金字塔)
研究了11种实时聊天软件,我发现都具备这些功能…
音视频、编解码相关电子书、小工具,打包奉送!
GC garbage collection
随机推荐
Ffmpeg error code
PowerDesigner设计Name和Comment 替换
Live HLS protocol
Linux下安装Redis,并配置环境
测试自学人必看:软件测试如何找测试项目?
Solution and summary of Nacos startup failure
[SQL optimization] the difference between with as and temporary tables
2022/5/23-2022/5/30
【无标题】
brpc理解
宝,运维100+服务器很头疼怎么办?用行云管家!
Regular expression =regex=regular expression
Basic knowledge of audio coding and decoding
Ffmpeg common commands (2)
ffmpeg 错误码
Interview question 16.16 Partial sorting - Double finger needling
简版拼多多商品数据
How to configure webrtc video streaming format for easygbs, a new version of national standard gb28181 video platform?
qobject_cast用法
Why has instagram changed from a content sharing platform to a marketing tool? How do independent sellers use this tool?