title: What are GC roots for classes?
body: <p>In Java, there are special objects called <strong>Garbage Collection Roots</strong> (GC roots). They serve as a root objects for Garbage Collection marking mechanism (see picture). </p>
  
  <p><img src="https://i.stack.imgur.com/8ehun.jpg" alt="enter image description here"></p>
  
  <p><a href="http://www.w3resource.com/java-tutorial/garbage-collection-in-java.php" rel="noreferrer">This article</a> describes four types of GC roots:</p>
  
  <ul>
  <li>local variables</li>
  <li>active threads</li>
  <li>static variables </li>
  <li>JNI references</li>
  </ul>
  
  <p>It is also mentioned, that:</p>
  
  <blockquote>
    <p>Classes themselves can be garbage-collected.</p>
  </blockquote>
  
  <p>GC roots aren't collected thus classes themselves are not GC roots. </p>
  
  <p>So what are GC roots for the classes?</p>