What happens when a subclass outside the package of the superclass overrides a protected method of it's superclass? According to what I see in the following code, the method becomes visible to all classes in the same package as the subclass.
The code compiles and runs OK. Then the question is, am I not breaking the whole purpose of "protected"?
According to the Outback class its accessing the method of Legacy not Car, Now its upto the implementor of Legacy class (who has been given the privilege to extend Class Car by the author of that Class) to implement the method. If the Legacy class programmer has the option of giving access to any protected member(incl. vars/methods) of CAR Class to other classes through its method. Its a implementation choice of Legacy Class Programmer.The Car class author knew that the method could be accessed in such a way and still kept the method protected so he didn't want to guard from a implementation like this.