Please don't consider this question as duplicate although I have a similiar question earlier but this time it is different..
Map m = new LinkedHashMap();
m.put ("123", "23");
m.put ("323", "23");
m.put ("153", "23");
m.put ("623", "23");
m.put ("125", "23");
m.put ("122", "24");
m.put ("167", "24");
m.put ("173", "24");
m.put ("113", "25");
Now my query is is that I need to find out the that how many scripts are there associated with patient Id 23 as seen above 5 total different scripts are there,
I have done this..
List<String> keys = new ArrayList<String>();
for(String str: m.keySet())
{
if(m.get(str).equals("23")) {
keys.add(str);
}
}
but it shows complier error cannot convert object to string please advise.