Protected methods are inherited by subclasses, so the subclass can invoke its
own inherited
test() method. However, this still doesn't give it the right to invoke its parent's test() method using a parent reference.
In other words, if ClassA has a protected method myMethod, a class in a different package can
never invoke myMethod() using a ClassA reference. This is true even if the other class is a subclass of ClassA. Being a subclass only gives it the right to invoke myMethod() using a reference to its own class type--not the parent's type.
It works when you remove the package declarations because this then puts both classes in the same package--and protected methods are always visible to all classes in the same package.
[ October 29, 2007: Message edited by: Kelvin Lim ]