How to make data member accessible to class and subclass only
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5300163/why-is-there-no-sub-class-visibility-modifier-in-java">Why is there no sub-class visibility modifier in Java?</a>  </p>
</blockquote>



<p>The access level table for Java, shows 4 different options for controlling access to members of a class:</p>

<pre><code>Modifier    Class  Package Subclass World
public      Y      Y       Y        Y
protected   Y      Y       Y        N
no modifier Y      Y       N        N
private     Y      N       N        N
</code></pre>

<p>There is no modifier, however, for "accessible to class and subclass only". That is:</p>

<pre><code>Modifier    Class  Package Subclass World
c++prot     Y      N       Y        N
</code></pre>

<p>Is it possible at all to define such access level in Java?</p>

<p>If so, how?</p>

<p>If this isn't possible, this must be due to a well thought design principle. If so, what is that principle. In other words, why having such access level in Java isn't a good idea?</p>
