How to get percentile in java

So i haven worked that much with HashMaps, but looking at the JavaDoc it should be something like

Hashmap<Integer><String> h;
int sum = 0;
for(int i: h.keySet()) {
  sum += i;
}
double percentile = sum/h.size()

Leave a Comment