title: Creating an instance from String in Java
body: <p>If I have 2 classes, "A" and "B", how can I create a generic factory so I will only need to pass the class name as a string to receive an instance?</p>
  
  <p>Example:</p>
  
  <pre><code>public static void factory(String name) {
       // An example of an implmentation I would need, this obviously doesn't work
        return new name.CreateClass();
  }
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>Joel</p>