title: How can i instantiate a different subclass based on common identifier (java)
body: <p>I have a class for a tile.</p>
  
  <pre><code>public abstract class Tile {
      public Position pos;
      public char chr;
  }
  </code></pre>
  
  <p>And many different classes that extend tile. Each subclass has its own identifier char.
  Now I have a function that receives a char and a position and needs to create and return a new instance of a tile subclass fitting the char in given position.
  Is there an elegant OOP way to do this other than run through all of the options?</p>