当前位置:网站首页>[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]
}
}
边栏推荐
猜你喜欢
随机推荐
[SQL optimization] the difference between with as and temporary tables
118. 杨辉三角
IPv4 address, subnet mask, gateway
axure不显示元件库
Introduction to relevant processes and functions of wechat official account development
Solution and summary of Nacos startup failure
Analysis of GetMessage underlying mechanism
【let var const】
GC垃圾回收
[info() method in org.slf4j.logger]
HLS4ML报错The board_part definition was not found for tul.com.tw:pynq-z2:part0:1.0.
H264 encoding profile & level control
较真儿学源码系列-InheritableThreadLocal(逐行源码带你分析作者思路)
安装sharp报错
Werewolf killing strategy: do you think I'm easy to cheat? Who do we believe!
Time series analysis using kibana timelion
产品模块化设计的前世今生
音视频、编解码相关电子书、小工具,打包奉送!
HLS4ML/vivado HLS 报错解决方案
mysql 报错 Can‘t create table ‘demo01.tb_Student‘ (errno: 150)*