title: Football Team: Objects and Classes
body: <p>Before I post my question, I just need guidance on how to improve my java program, because I want to learn.</p>
  
  <p>So, for my assignment I need to:</p>
  
  <p>Create 3 classes, app, football player and football team.The application (app) will use the two other classes (football player and football team).</p>
  
  <p>app will</p>
  
  <ul>
  <li>create 11 football players (you can place them in an array or
  ArrayList)</li>
  <li>create a football team using the players above use the
  football team instance (object) to display the information requested
  in the lab </li>
  </ul>
  
  <p>a football player class</p>
  
  <ul>
  <li>has at least 5 attributes from
  your choice a method that returns the complete info about the player</li>
  </ul>
  
  <p>a football team class has</p>
  
  <ul>
  <li>a name and a mascot</li>
  <li>11 football players</li>
  <li>any other attributes (optional)</li>
  <li>a method that displays all the information about a team including:
  
  <ul>
  <li>name</li>
  <li>mascot, and information on each player in the team</li>
  <li>a method that display information about a specific player in the team using an input parameter such as the player position or player number for instance. For instance, from team A, displays information about the quarterback, or display information about player number 5.</li>
  </ul></li>
  </ul>
  
  <p>I'm confused with my team class. I don't know how to add 11 players to the class and provide an input parameter for the player instance. I'm unsure about my app class because I don't know how to use the football team instance (object) to display the information requested in the lab.</p>
  
  <p>Here is what I have so far</p>
  
  <pre><code>public class app {
  public static void main(String[] args)
  {
          player pl1 = new player
          ("Christian","Campbell","Cornerback","Alabama","Central");
              System.out.println(pl1.getInfo());
  
          player pl2 = new player
          ("Marcus","Allen","Safety","Maryland","Dr. Henry A. Wise, Jr");
              System.out.println(pl2.getInfo());
          player pl3 = new player 
          ("Tommy","Stevens","Quarterback","Indiana","Decatur Central");
              System.out.println(pl3.getInfo());
          player pl4 = new player
          ("Nyeem","Wartman-White", "Linebacker","Pennsylvania","Valley View");
               System.out.println(pl4.getInfo());
          player pl5 = new player
          ("George", "Foreman", "Defensive back","Georgia","Parkview");
              System.out.println(pl5.getInfo());
          player pl6 = new player
          ("Andre","Robinson","Right Tackle","Pennsylvania","Bishop McDevitt");
              System.out.println(pl6.getInfo());
          player pl7 = new player
          ("Malik","Golden","Safety","Connecticut","Chesire Academy");
              System.out.println(pl7.getInfo());
          player pl8 = new player
          ("Koa","Farmer","Safety","California","Notre Dame");
              System.out.println(pl8.getInfo());
          player pl9 = new player
          ("Jake","Zembiec","Quarterback","New York","Aquinas Institute");
              System.out.println(pl9.getInfo());
          player pl10 = new player
          ("Brandon","Polk","Wide Receiver","Virgina","Briar Woods");
              System.out.println(pl10.getInfo());
          player pl11 = new player
          ("Trace","McSorley","Quarterback","Virgina","Briar Woods");
              System.out.println(pl11.getInfo());
  
  
    }
  
  }
  
  public class player {
  
  
  
  //---------Declaring attributes----
      String firstName;
      String lastName;
      String position;
      String State;
      String Highschool;
  
  
      player (String inf_firstName, String inf_lastName, String inf_position, String inf_State, String inf_Highschool)
  {
              firstName = inf_firstName;
              lastName = inf_lastName;
              position = inf_position;
              State = inf_State;
              Highschool = inf_Highschool;
      }
  String getInfo()
  {
      return "Name: "+firstName+ " "+lastName+", "+"position: " +position+ ", State: " +State+ ", High School: " +Highschool; 
    }
  
  }
  
  public class team {
  
     String team = "Penn State";
     String mascot = "Nittany Lions";
  
      team(String inf_team, String inf_mascot)
        {
          team = inf_team;
          mascot = inf_mascot;                             
        }
  team t1 = new team("Penn State", "Nittany Lions");
  
       String getInfo()
       {
         return "Team Name: "+team+ "Team Mascot: "+mascot;
       }
  }
  </code></pre>