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
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() {
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.