Java Reference
In-Depth Information
tents and purposes, the compareByGoals() method is the same as a Comparat-
or .
public class Player {
private String firstName = null;
private String lastName = null;
private String position = null;
private int status = -1;
private int goals;
public Player(){
}
public Player(String position, int status){
this.position = position;
this.status = status;
}
protected String playerStatus(){
String returnValue = null;
switch(getStatus()){
case 0:
returnValue = "ACTIVE";
case 1:
returnValue = "INACTIVE";
case 2:
returnValue = "INJURY";
default:
returnValue = "ON_BENCH";
}
return returnValue;
}
public String playerString(){
Search WWH ::




Custom Search