我的问题是,当我运行代码时,如果运行了 if 语句,但随后绕过了 for 循环。我是新手,这是第一篇文章。欢迎所有帮助。
if (tMenuChoice == 1)
{
System.out.println("How many teams are there going to be?");
int tNumberOfTeams = tKeyboard.nextInt();
// This is where the code stops running. The for loop is not read but bypassed.
for (int i = 1; i == tNumberOfTeams;i++)
{
System.out.println("Team " + i + "'s name?");
String tNameOfTeam = tKeyboard.nextLine();
String [] tTeamArray = new String[i];
}
}
谢谢