Protected function not visible in subcass of a different package
<pre><code>package protectedexample;

public class Animal {

    protected void speak(){

        System.out.println("default speaking");
    }

    public void eat(){

        System.out.println("default speaking");
    }



    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        Animal a=new Animal();
        a.speak();


    }

}



package cloning;

import protectedexample.Animal;

public class TestAnimal extends Animal{

    /**
     * @param args
     */
    public static void main(String[] args) {

        Animal a=new Animal();
        a.speak();//Error is coming Method speak() of class animal is not visible
    }

}
</code></pre>

<p>What is the reason of the above compile time error is coming -- Method speak() of class animal is not visible, when I know that a protected member is visible in it's sublcass across any package</p>