title: Protected inner-class is NOT accessible from subclass of another package
body: <p>I have the following code in Java:</p>
  
  <pre><code>package a;
  public classs ClassInOtherPackage{
      protected void protectedMethod(){}
       protected class protectedInnerClass {}
  }
  
  package b;
  import a.*;
  public class MyClass extends ClassInOtherPackage{
    public MyClass(){
      MyClass x = new MyClass();
      x.protectedMethod();  //&lt;-- This one ok
      //UPDATED: Declaration is ok
      MyClass.protectedInnerClass y; //&lt;-- This one ok
      //UPDATED: Only when instantiated is not allowed, why?
      y = x.new protectedInnerClass(); //&lt;-- Not allow when instantiated.
    }
  }
  </code></pre>
  
  <p>Refer to the Java documentation: </p>
  
  <blockquote>
    <p>"The protected modifier specifies that the member can only be accessed
    within its own package (as with package-private) and, in addition, by
    a subclass of its class in another package."</p>
  </blockquote>
  
  <p>Why can't I instantiate the inner protected class as shown above?</p>