title: Dynamically calling a class method in java?
body: <p>Is it possible to dynamically call a method on a class from java?</p>
  
  <p>E.g, lets say I have the reference to a class, e.g either the string: 'com.foo.Bar', or <code>com.foo.Bar.class</code>, or anything else which is needed..). And I have an array / list of strings, e.g <code>[First, Last, Email]</code>. </p>
  
  <p>I want to simply loop through this array, and call the method <code>'validate' + element</code> on the class that I have a reference to. E.g:</p>
  
  <pre><code>MyInterface item = //instantiate the com.foo.Bar class here somehow, I'm not sure how.
  
  item.validateFirst();
  item.validateLast();
  item.validateEmail();
  </code></pre>
  
  <p>I want the above lines of code to happen dynamically, so I can change the reference to a different class, and the names in my string list can change, but it will still call the <code>validate + name</code> method on whichever class it has the reference to.</p>
  
  <p>Is that possible?</p>