gehadadel / SWApp

SW2ProjectFCI
0 stars 0 forks source link

Statistics #5

Open 23262 opened 6 years ago

23262 commented 6 years ago

@gehadadel

`public class Tessssst {

public static void main(String[] args) {
    HashMap<String, Integer> pro=new HashMap();
    Pair<String,Integer> highproduct = new Pair<>("",0);
    int maxValueInMap=(Collections.max(pro.values()));
    for (Entry<String, Integer> entry : pro.entrySet()) {  // Itrate through hashmap
    if (entry.getValue()==maxValueInMap) {
        System.out.println(entry.getKey());     // Print the key with max value
    //  highproduct
   //   =<entry.getValue(),entry.getKey()>;
       highproduct = new Pair<>(entry.getKey(),entry.getValue());

    }
}
}

}`

this is the code that mention to you this is correct but not work in the spring boot