您好,我正在尝试在游戏中创建指定数量的玩家。我已经循环了播放器的创建,但是每次循环时,它都应该从制作 player1 到制作 player2 我如何构造一个我在具有该特定字符串的单独文件中定义的类?
System.out.println("input starting monies in millions of dollaz");
double starterplayermoney = Double.valueOf(keyboard.nextLine());
System.out.println("input total players");
double doubletotalplayers = Double.valueOf(keyboard.nextLine());
int i = 1 ;
while(i<=doubletotalplayers){
String playerstring = "player"+Integer.toString(i);
player playerstring = new player();
i++;
}