Collections and Generics
© examsiri.com
Question : 32 of 53
Marks:
+1,
-0
Given:
Which method will complete this class?
1. public class Score implements Comparable < Score > {
2. private int wins, losses;
3. public Score(int w, int 1) { wins = w; losses = 1; }
4. public int getWins() { return wins; }
5. public int getLosses() { return losses; }
6. public String toString() {
7. return “<“ + wins + “,“ + losses + “>”;
8. }
9. /* insert code here*/
10. }Which method will complete this class?
Go to Question: