import java.util.HashMap;
import java.util.Map;
public class Main{
public static void main(String[] args) {
HashMap<Integer,Integer> map=new HashMap<>();
//key---value
map.put(1,2);
map.put(2,3);
map.put(3,4);
map.put(4,5);
for (Map.Entry<Integer,Integer> entry:map.entrySet()){
if (entry.getValue().equals(3)){
//查找value等于3所对应的key值
System.out.println("value:"+ 3 + "所对应的key值为:"+entry.getKey());
}
else if (entry.getValue().equals(2)) {
//查找value等于2所对应的key值
System.out.println("value:"+ 2 + "所对应的key值为:" + entry.getKey());
}
}
}
}