我有一个Game
带有属性“状态”的类,这个属性将只是“玩家”或“教练”,我怎么能这样做?我会给你我是如何尝试的
class Status{
public static final String player = "player";
public static final String coach = "coach";
}
class Game {
String status;
Game(String status){
this.status = status;
}
}
class Main{
public static void main(String args[]){
new Game(Status.player);
new Game(Status.coach);
}
}
谢谢你