public class Team {
private String name, sport;
private int numOfWins, numOfLosses;
public Team(String name, String Sport){
this.name= name;
this.sport= Sport;
numOfWins= 0;
numOfLosses= 0;
}
public int addAnotherWin(){
return numOfWins++;
}
public int addAnotherLoss(){
return numOfLosses++;
}
public int getNumWins(){
return numOfWins;
}
public int getNumLosses(){
return numOfLosses;
}
public void resetWinsAndLosses(){
numOfWins= numOfWins*0;
numOfLosses= numOfLosses*0;
}
public double getPercentOfGamesWon(){
double z= numOfWins/ numOfWins+numOfLosses;
return z;
}
public boolean equals(){
}
public String toString(){
}
}
So my equals method is suppose to compare two teams and return if they are equals if their PercentOfGamesWon is equal to each other, but I don't know how to write that, any help please? Another thing i need help with is the toString, i'm not sure what its for and what i'm suppose to write in it. I just started coding so sorry if this is a noob question.