title: Creating multiple objects of the same type with user input?
body: <p>I'm trying to make a program with three class files, two Objects files and one Main that accesses both and runs operations. The first object file creates objects with one parameter, and then assigns attributes to itself based on said parameter, for example.</p>
  
  <pre><code>public class People {
      private int height, weight;
      private String specificPerson;
      public People(String  person){
          this.specificPerson = person;
          this.height = person.length * 12;
          this.weight = person.length * 40;
      }
  
      public int getHeight(){return height;}
  
      public int getWeight() {return weight;}
  }
  </code></pre>
  
  <p>These objects are then stored within the array of another object which has a capacity and an array:</p>
  
  <pre><code>public class peopleIndexer {
      private int pcapacity, size;
      private String[] peopleArray;        
      public peopleIndexer(int capacity){
          this.pcapacity = capacity;
          this.peopleArray = new String [capacity];
      }
  
      public int getCapacity(){
          return pcapacity;
      }
  
      public int[] getInfo(String person){
          int[] getInfo = new int[2];
          int found = Arrays.binarySearch(peopleArray,person);
          getInfo[0] = ?.getHeight();
          getInfo[1] = ?.getWeight();//I dont know the object name yet so I put "?" for I am not sure
          System.out.println("Person" + person + "is " + getInfo[0] + "tall and " + getInfo[1] + " pounds.");
      }
  
  }
  </code></pre>
  
  <p>What I need to know is how to allow the user to make multiple people in the list with input that I can then allow them to retrieve later, for example:</p>
  
  <pre><code>String user_input;
  People user_input = new People("user_input");
  </code></pre>
  
  <p>So that if the users input were to be jack, ryan, and nick, I would have three objects placed in the peopleIndexer as such:</p>
  
  <pre><code>People jack = new People(jack);
  People ryan = new People(ryan);
  People nick = new People(nick);
  </code></pre>