I have a hashmap when i am printing this hashmap the output is like this
{KEY_CH_UP=KEY_CH_UP, KEY_PANEL_CH_UP=KEY_PANEL_CH_UP, KEY_7=KEY_7, KEY_6=KEY_6, KEY_5=null}
Now i want to get all the keys which is having
values == null ;
I have a hashmap when i am printing this hashmap the output is like this
{KEY_CH_UP=KEY_CH_UP, KEY_PANEL_CH_UP=KEY_PANEL_CH_UP, KEY_7=KEY_7, KEY_6=KEY_6, KEY_5=null}
Now i want to get all the keys which is having
values == null ;
Iterate over the like below and check if the value is null :
Map<String, String> map = new HashMap<String, String>();
for(Map.Entry<String, String> en: map.entrySet()){
if(en.getValue()==null){
System.out.println(en.getKey());
}
}