Why do some programs loadClass instead of new'ing up the class in Java
<p>In one of the Spring classes, <code>org.springframework.web.servlet.view.tiles2.TilesConfigurer</code>, the following code is run:</p>

<pre><code>Class clazz = getClass().getClassLoader().loadClass(
    "org.apache.tiles.extras.complete.CompleteAutoloadTilesInitializer");
this.tilesInitializer = (TilesInitializer) clazz.newInstance();
</code></pre>

<p>Why didn't the author just write</p>

<pre><code>this.tilesInitializer = new org.apache.tiles.extras
    .complete.CompleteAutoloadTilesInitializer()
</code></pre>

<p>Is there a difference in the output or an improvement to doing it the first way?</p>

<p><strong>Update</strong> The code in the TilesConfigurer class is exactly as in the first example.  It is not loading the string out of a DI layer.  It's a hard coded string.</p>
