java - Printing objects in a 2-D array using deepToString -


I am trying to write a Java application that will simulate football fixtures (in the style of the World Cup) and The match will produce the report and the results randomly, since I want to hand over every team to the players, I should have teams to have an object instead of just stars. This is proving problematic because I am struggling to print a complete list of teams on the application run. So far I have for Team category:

  import java.util.Arrays; Public Sector Team {Public Stable Team Team 1 = New Team (); Public stable team team 2 = new team (); Public stable team team 3 = new team (); ... public stable team team 16 = new team (); Public stable team [] [] Full tilelist = {{Team 1, Team 2, Team 3, Team 4}, {Team 5, Team 6, Team 7, Team 8}, {Team 9, Team 10, Team 11, Team} 12}, {Team 13, Team 14, Team 15, Team 16}}; Public static zero print FULTemList () {System.out.println (Arrays.deepToString (fulltemlist)); }}   

(At some point I will change the team names manually, this is why I decided not to use a loop to instantiate the teams)

and the main method reads:

  import java.util.Arrays; Public Sector Main {Public Stable Zero Main (String [] Args) {Team.printFullTeamList (); Unfortunately when I run this program:  
  [[Team @ 25d35bf2, Team @ 57398044, Team @ 141d19, Team @ 2882545 9], [Team @ 4187a8e0, ... ... >  

But if this is possible then I would like to return it:

  [[Team 1, Team 2, Team 3, Team 4, Team 5, ... Etc.   

Any help would be greatly appreciated

The toString method must be overridden in the team category. More details here:

Besides, I think Team 1, ... Team 16 should be kept elsewhere.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -