Skip to content

Commit 4e840d1

Browse files
CopilotProject516
andcommitted
Add JavaDoc for HighScore.toString() method
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
1 parent a93e0ff commit 4e840d1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • app/src/main/java/io/github/project516/NumberGuessingGame

app/src/main/java/io/github/project516/NumberGuessingGame/HighScore.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ public int compareTo(HighScore other) {
5858
return Integer.compare(this.numberOfGuesses, other.numberOfGuesses);
5959
}
6060

61+
/**
62+
* Returns a string representation of this high score in the format "username: X guess(es)".
63+
*
64+
* @return a formatted string containing the username and number of guesses
65+
*/
6166
@Override
6267
public String toString() {
6368
return username + ": " + numberOfGuesses + " guess" + (numberOfGuesses == 1 ? "" : "es");

0 commit comments

Comments
 (0)