title: Calling specific implementation classes of an Interface in Java
body: <p>I am trying to build a simple API, where I have an interface <code>AnimalService</code> and its implementation classes are <code>LionImpl</code>, <code>TigerImpl</code>, <code>ElephantImpl</code>.<br>
  <code>AnimalService</code> has a method <code>getHome()</code>.<br>
  And I have a properties file which contains the type of animal I'm using
  like, </p>
  
  <pre><code>animal=lion
  </code></pre>
  
  <p>So based on the animal type I am using, when I call my API (<code>getHome()</code> from <code>AnimalService</code>), the particular implementation class's <code>getHome()</code> method should be executed.<br><br>
  How can I achieve that?
  <br><br>
  Thanks in advance.</p>