title: Why subclass in another package cannot access a protected method?
body: <p>I have two classes in two different packages:</p>
  
  <pre><code>package package1;
  
  public class Class1 {
      public void tryMePublic() {
      }
  
      protected void tryMeProtected() {
      }
  }
  
  
  package package2;
  
  import package1.Class1;
  
  public class Class2 extends Class1 {
      doNow() {
          Class1 c = new Class1();
          c.tryMeProtected(); // ERROR: tryMeProtected() has protected access in Class1
          tryMeProtected();  // No error
      }    
  }
  </code></pre>
  
  <p>I can understand why there is no error in calling <code>tryMeProtected()</code> since <code>Class2</code> sees this method as it inherits from <code>Class1</code>.</p>
  
  <p>But why isn't it possible for an object of <code>Class2</code> to access this method on an object of <code>Class1</code> using   <code>c.tryMeProtected();</code>   ?</p>