title: How to print contents from 2 different arrays and have items grouped
body: <p>I'm trying to output a list of all the clubs along with the people entered for each club, but have it display each club individually (i.e. there is one club and the list of people for that club, then the second club entered and the people for that one and so on)</p>
  
  <p>I wanted to make sure the adding of objects to each array was correct and figure out what my <code>toString()</code> method should look like. </p>
  
  <p>Here's my code so far:</p>
  
  <pre><code>public class app {
  
      public static Club[] clubArray = new Club[5];
      public static int clubCount=0;
      public static int personCount=0;
  
      public static void main(String[] args) {
          //inside a add method
          //prompt user for club 
          clubArray[clubCount++] = new Club(clubName);
  
          //prompt user for name, then prompt for Male or Female
          if (x.equals("M")) {
              Male newPerson = new Male(name);
              clubArray[clubCount-1].addPerson(newPerson,personCount);
              personCount++;
          }
      }
  
      //data definition class
      public class Club { //extend app?
          public static Person[] personArray = new Person[200]; 
  
          public void addPerson(Person newPerson, int personCount){
              personArray[personCount] = newPerson;
          }
      }
  </code></pre>