+ 1

can you please correct mistake

import java.util.*; public class Bowling { HashMap<String, Integer> players; Bowling() { players = new HashMap<String, Integer>(); } public void addPlayer(String name, int p) { players.put(name, p); } //your code goes here public class Bowling { public static <K, V extends Comparable<V>> Map.Entry<K, V> getMaxEntryInMapBasedOnValue(Map<K, V>map) { Map.Entry<K, V> entryWithMaxValue = null; for (Map.Entry<K, V> currentEntry : map.entrySet()) { if (entryWithMaxValue == null || currentEntry.getValue();compareTo(entryWithMaxV alue.getValue()) > 0) { entryWithMaxValue = currentEntry; see q} } return entryWithMaxValue; } public static void print(players <String, Integer> players ) { System.out.printIn("John"100); if (players .isEmpty()) { System.out.println("[]"); } else { System.out.println(map); } } public static void main(String[] args

25th Feb 2021, 11:43 AM
wenona saranza
wenona saranza - avatar
1 Odpowiedź
25th Feb 2021, 11:55 AM
JaScript
JaScript - avatar