title: What does the protected modifier mean?
body: <p>I am reading the book <a href="https://rads.stackoverflow.com/amzn/click/com/0201704331" rel="noreferrer" rel="nofollow noreferrer">The Java Programming Language, 3rd edition</a>.</p>
  
  <p>In chapter 3.5 , it illustrates the <code>protected</code> modifier with the following words:</p>
  
  <blockquote>
    <p>More precisely, beyond being accessible within the class itself and to code within the 
        same package, a protected member can also be accessed from a class through object references 
        that are of at least the same type as the class that is, references of the class's type or 
        one its subtypes.</p>
  </blockquote>
  
  <p>The words makes me confused, in <strong>two</strong> aspects:</p>
  
  <p><strong>1.</strong> protected member can be accessed by code within the same package ? What I knew before is protected member can only be accessed by the subclass...</p>
  
  <p><strong>2.</strong> I don't understand what does <code>a protected member can also be accessed from ...</code> mean, anyone can explain to me please?</p>