title: Java ClassLoader delegation model?
body: <p>When calling <code>loadClass()</code> on a <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html" rel="nofollow noreferrer"><code>ClassLoader</code></a>, does the <code>ClassLoader</code> first check if the class has been loaded, or does it immediately delegate this check to its parent <code>ClassLoader</code>?</p>
  
  <p>Java API says:</p>
  
  <blockquote>
    <p>When requested to find a class or resource, a ClassLoader instance will delegate the search for the class or resource to its parent class loader before attempting to find the class or resource itself.</p>
  </blockquote>
  
  <p>But there's a specific chapter about class loader in the book <em>Java Reflection in Action</em> that says:</p>
  
  <blockquote>
    <p>Class loader calls findLoadedClass to check if the class has been loaded already. If a class loader does not find a loaded class, calls loadClass on the parent class loader.</p>
  </blockquote>
  
  <p>Which is correct?</p>