title: Why can't my subclass access a protected variable of its superclass, when it's in a different package?
body: <p>I have an abstract class, <code>relation</code> in package <code>database.relation</code> and a subclass of it, <code>Join</code>, in package <code>database.operations</code>. <code>relation</code> has a protected member named <code>mStructure</code>. </p>
  
  <p>In <code>Join</code>:</p>
  
  <pre><code>public Join(final Relation relLeft, final Relation relRight) {
          super();
          mRelLeft = relLeft;
          mRelRight = relRight;
          mStructure = new LinkedList&lt;Header&gt;();
          this.copyStructure(mRelLeft.mStructure);
  
          for (final Header header :mRelRight.mStructure) {
          if (!mStructure.contains(header)) {
              mStructure.add(header);
          }
      }
  }
  </code></pre>
  
  <p>On lines</p>
  
  <pre><code>this.copyStructure(mRelLeft.mStructure);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>for (final Header header : mRelRight.mStructure) {
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>The field Relation.mStructure is not visible</p>
  </blockquote>
  
  <p>If I put both classes in the same package, this works perfectly. Can anyone explain this issue?</p>