title: Oracle Java tutorial - possible error at answer to question
body: <p>I'm new to Java, reading Oracle tutorial.
  After each section, there are questions and answers, and I don't understand a sentence within one answer (see below bolded line).</p>
  
  <p>source is <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/QandE/objects-answers.html" rel="noreferrer">https://docs.oracle.com/javase/tutorial/java/javaOO/QandE/objects-answers.html</a></p>
  
  <p>I'm referring to question 2, see the bolded words. As far as I understand, an array is eligible to garbage collection, if there is no reference to the array. It does not matter, whether there is a reference to the objects held by this array, as the inner objects (within the array) have their own reference counting. Is that right? Please explain the bolded sentence.</p>
  
  <p>cite from oracle tutorial: <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/QandE/objects-answers.html" rel="noreferrer">https://docs.oracle.com/javase/tutorial/java/javaOO/QandE/objects-answers.html</a></p>
  
  <blockquote>
    <ol start="2">
    <li><p>Question: The following code creates one array and one string object.
    How many references to those objects exist after the code executes? Is
    either object eligible for garbage collection?</p>
  
  <pre><code>String[] students = new String[10];
  String studentName = "Peter Smith";
  students[0] = studentName;
  studentName = null;
  </code></pre>
    
    <p>Answer: There is one reference to the students array and that array
    has one reference to the string Peter Smith. Neither object is
    eligible for garbage collection. <strong>The array students is not eligible
    for garbage collection because it has one reference to the object
    studentName even though that object has been assigned the value
    null</strong>. The object <code>studentName</code> is not eligible either because
    <code>students[0]</code> still refers to it.</p></li>
    </ol>
  </blockquote>