title: Java: Difference between Class.forName and ClassLoader.loadClass
body: <p>What is the difference between <code>Class.forName</code> and <code>ClassLoader.loadClass</code> in the following codes:</p>
  <pre><code>Class theClass = Class.forName(&quot;SomeImpl&quot;);
  SomeImpl impl = (SomeImpl)theClass.newInstance();
  </code></pre>
  <p>and</p>
  <pre><code>Class theClass = ClassLoader.loadClass(&quot;SomeImpl&quot;);
  SomeImpl impl = (SomeImpl)theClass.newInstance();
  </code></pre>
  <p>Are they synonymous? Is one preferable to the other in certain circumstances? What are the do's and dont's when using these two methods?</p>