title: Initializing objects dynamically
body: <p>The following code is a simplified version. The <code>Write</code> and <code>Read</code> are classes that implement the <code>IAction</code> interface.</p>
  
  <pre><code>IAction newAction;
  if (userInput.equalsIgnoreCase("WRITE")){
      newAction = new Write();
  }
  else if (userInput.equalsIgnoreCase("READ")){
      newAction = new Read();
  }
  ...
  </code></pre>
  
  <p>If I had many actions to implement then i would have to go through too many if statements. So the question is if there is a way to automatically create each class without getting through all these if statements?</p>