package pack1;
class Animal
{
protected void printMe()
{
System.out.println("in Animal's printme method");
}
}
package pack2;
import pack1.Animal;
class Horse extends Animal
{
public static void main(
String args[])
{
Animal a = new Animal();
a.printme();
}
}
it gives me the error for protected access specifier.
why it is so ? we can access data from different package with protected by extending class.. ???