Visibility of protected field
<pre><code>package p1;

public class MyClass1 {

      protected static  String str = "ss1";

    }

package p2;

import p1.MyClass1;

public class MyClass2 extends MyClass1 {

     public static void test(){

         MyClass1 mc1 = new MyClass1();

         System.out.println(mc1.str); 

         }

}
</code></pre>

<p>As I understand it, the print statement will not work if the String is declared as protected  as it is not visible from a different package. But why does it work when is declared as static protected ?</p>
