0

Why doesn’t this work?

Working for an hour again 
 It kept showing incompatible types of so 
 Hope someone can help! https://code.sololearn.com/cDaohUTAY3rK/?ref=app

11th Feb 2022, 2:25 AM
Albert Tan
2 Answers
0
Set.toArray() returns Object[] but you can specifi return type in parameter String[] keys = players.keySet() //.toArray(); .toArray(new String [0]); return in getWinner is inside for() //return largestName; } return largestName; getWinner() not need parameter, can access HashMap inside Bowling object. //public String getWinner(HashMap players) { public String getWinner() {
11th Feb 2022, 4:39 AM
zemiak
0
Your getWiner() method currently needs a raw HashMap. You should remove it so it uses the instance variable players instead and then add a return statement to line 23 if there are no winners.
11th Feb 2022, 4:50 AM
Kamen Studentov
Kamen Studentov - avatar