欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

java根据value获取Map对象的key

程序员文章站 2022-07-17 08:05:52
Map map= new HashMap(); for(Map.Entry entry : map.entrySet()){ if(entry.getValue().equals("符合条件")){ Str ......
   
map<string, string> map= new hashmap<string,string>();

for(map.entry<string, string> entry : map.entryset()){
if(entry.getvalue().equals("符合条件")){ string key = entry.getkey(); } }