java - Why is the 2nd for loop is not running? -
class test { public static void main(string args[]) { tournament t = new tournament(); team t = new team(); t.getinfo2(); /*t.display2(); t.teamobject();*/ int teams = t.num_team; int players; team[] tarr = new team[teams]; (int = 0; < teams; i++) { tarr[i] = new team(); tarr[i].getinfo1(); players = t.num_players; player[] parr = new player[players]; (int j = 0; j < players; j++) { parr[j] = new player(); parr[j].getinfo(); } } }
why 2nd loop not running? there no compile time error or run time error. not able sort out problem.
the second loop executing intended. t.num_players
0 getting assigned players.
Comments
Post a Comment