Quote
My code is giving me trouble......its telling it cant find variable length
public void addTeam()
{
System.out.print("\nWould you like to add the teams to group 1 or 2: ");
int selection = scan.nextInt();
System.out.println("");
for(int z = 1; z <= 4; z++)
{
System.out.print("Enter the name of the team: ");
String name = scan.next();
System.out.print("Enter the location of the team: ");
String location = scan.next();
System.out.println("");
Team team = new Team(teamLocation, teamName);
if(selection == 1){groupA.addTeam();}
else
{groupB.addTeam();}
}
for(int index = 0; index < groupB.length; index++)
{
boolean addTeamtoGroup = false;
if(group[index] == null && addTeamtoGroup == false)
{
group[index] = team;
addTeamtoGroup = true;
// break;
}
}
return true;
}

New Topic/Question
Reply



MultiQuote






|