Why java packages do not work as a hierarchy? : <p>why java does not allow access to package restricted types that are in parents package?</p>

<p>With something like :</p>

<pre><code>Package a
|--Class A
|--Package b
   |--Class B
</code></pre>

<p>It is not possible to access class <code>A</code> from class <code>B</code> if class <code>A</code> has package visibility. I thought it make sense but apparently not.</p>

<p>What is the reason for that?</p>
