title: Java, call object methods through arraylist
body: <p>Based on this question  <a href="https://stackoverflow.com/questions/7762848/increment-variable-names">Increment variable names?</a></p>
  
  <p>I have an arraylist 'peopleHolder' which holds various 'person' objects.
  I would like to automatically create 'person' objects based on a for loop.
  I did the following</p>
  
  <pre><code>    peopleHolder.add(new person());
  </code></pre>
  
  <p>I would like to call methods from the person class. for example person.setAge;
  How can I call such methods through an arraylist?
  I would like the method to set values for each object.
  I have looked at this answer: <a href="https://stackoverflow.com/questions/17067728/java-calling-methods-of-an-object-that-is-in-arraylist">Java - calling methods of an object that is in ArrayList</a><br>
  But I think the solution depends on calling static method and I would like to have the method specific to the object as they store the objects value.</p>