title: Difference between Thread.currentThread() classLoader and normal classLoader
body: <p>Can you tell me what is the difference between <code>Thread.currentThread().getContextClassLoader()</code> and <code>TestServlet.class.getClassLoader()</code> do not mark it as duplicate and also please explain as well as provide me example when to use these</p>
  
  <p>Java File:</p>
  
  <pre><code>package com.jar.test;
  
  public class TestServlet {
      public static void main(String args[]) {    
          ClassLoader cls = TestServlet.class.getClassLoader().loadClass(
                  "com.jar.test.TestServlet");
          ClassLoader cls = Thread.currentThread().getContextClassLoader()
                  .loadClass("com.jar.test.TestServlet");
      }
  }
  </code></pre>