title: Java Class loading
body: <p>I want to understand how Java class loaders works. I have read some articles, but there are some things are still unclear to me.</p>
  
  <p>As far as I understand the first class loader is the Bootstrap class loader (BCL). <strong>Is it loaded by the JVM?</strong></p>
  
  <p>Afterwards, the BCL loads rt.jar library, and the Extension Class Loader (ECL).</p>
  
  <p>In turn, the ECL loads extensions and the Application Class Loader (ACL). The ACL is responsible for loading all user-developed class from the classpath.</p>
  
  <p>Is this description correct?</p>
  
  <p>There some questions: </p>
  
  <ol>
  <li>There is only one instance of each classloader exists in memory ? (BCL,ECL,ACL) ?  </li>
  <li>I have looked at delegation principle,but it is a little bit unclear for me. How does it work, let's assume we need load MyClass. First jvm gives this class name to the ACL, and here is unclear thing for me, ACL looks through class path and if there is no such class delegates this work to the parent OR it delegates this work to parent right after calling, I mean JVM gives class name to ACL, it doesn't search for this class gives it to ECL, this CL in turn also doesn't do any work and gives it to BCL, and only if BCL cannot find this class it return it to the lower level (ECL) .... and so on. What is the correct chain ?</li>
  <li>When we creating custom class loader what is parent class of it ? Application ClassLoader ? Can we specify , for instance ECL. As far as hierarchy of class loaders is not inheritance, we specify parent in constructor. Can we get instance of ECL classloader to specify it in our custom CL as a parent in constructor. </li>
  <li>Why classes like String , Object and so on don't return any ClassLoadder ? </li>
  </ol>