title: Loading a Class from a String
body: <p>I want to instantiate a class by the value of a String.  I found several tutorials that show several methods for doing this.  The class MUST inherit from a certain interface, <code>ImplementMe</code> which has a special method called <code>runMe()</code>.  So here's what I tried:</p>
  
  <pre><code>ImplmentMe a =
     (ImplementMe) ImplementMe.class
                     .getClassLoader()
                     .loadClass("my.package.IImplementedYou")
                     .newInstance();
  a.runMe();
  </code></pre>
  
  <p>It works, but it's so ugly.  I at least expected not needing a cast.  Please tell me there is a better way.</p>