title: Java member access when class has default access
body: <p>Say I have a class declared with default access. If a member in the class is declared <code>protected</code> or <code>public</code>, is it equivalent to the member being declared with <code>default</code> access?</p>
  
  <p>For example:</p>
  
  <p>In CarA.java:</p>
  
  <pre><code>class CarA { //class declared with default access
     public int odometer;
     protected void forward(int distance){...
     }
     protected static void tally(){...
     }
  }
  </code></pre>
  
  <p>In CarB.java:</p>
  
  <pre><code>class CarB { //class declared with default access
     int odometer;
     void forward(int distance){...
     }
     static void tally(){...
     }
  }
  </code></pre>
  
  <p>Are <code>CarA</code> and <code>CarB</code> equivalent? </p>
  
  <p>My reasoning is that since the class is not declared as <code>public</code>, the class is not accessible outside of its package, so its members should not be accessible outside of its package as well. Could someone confirm my thinking is correct?</p>