I am trying to find max value in a Map and get its corresponding key.
This is my maxMin =
{3=0.1518355013623417, 2=0.11815917264727849, 1=0.2467498197744391, 4=0.04812703040826949}
for(String keyset: maxMin.keySet()){
double values = maxMin.get(keyset);
if (values < min) {
min = values;
}
if (values > max) {
max = values;
}
}
And I found the max but how toget corresponding key?