MapTest.java
939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.bootdo.test;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.stream.Collectors;
public class MapTest {
public static void main(String[] args) {
Collectors.counting();
UserTestVO userVo = new UserTestVO();
UserTestVO userVo2 = new UserTestVO();
userVo.setPwdNew("1");
userVo2.setPwdNew("1");
System.out.println("userVo1="+userVo.getPwdNew()+" "+userVo.hashCode());
System.out.println("userVo2="+userVo2.getPwdNew()+" "+userVo2.hashCode());
HashSet<UserTestVO> ss = new HashSet<UserTestVO>();
ss.add(userVo);
ss.add(userVo2);
System.out.println(9);
HashSet<String> ss2 = new HashSet<String>();
ss2.add("1");
ss2.add("1");
System.out.println(99);
Map map = new HashMap<UserTestVO, Object>();
map.put(userVo, 1);
map.put(userVo2, 1);
System.out.println(999);
}
}