Which method will complete this class?

Given:
public class Score implements Comparable<Score> {
private int wins, losses;
public Score(int w, int l) { wins = w; losses = l; }
public int getWins() { return wins; }
public int getLosses() { return losses; }
public String toString() {
return "<" + wins + "," + losses + ">";
}
// insert code here
}
Which method will complete this class?
A. public int compareTo(Object o){/*more code here*/}
B. public int compareTo(Score other){/*more code here*/}
C. public int compare(Score s1,Score s2){/*more code here*/}
D. public int compare(Object o1,Object o2){/*more code here*/}

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.