Hopefully this is the right forum for my concern.
I'm reading the book "A Programmer's Guide to Java SE 8 Oracle Certified Associate by Khalid A Mughal and Rolf W Rasmussen" but I'm struggling with
an explanation about protected member and how they can not be accessed from an superclass object in another package, only from subclasses or subsubclasses.
(Example 4.10 illustrates the point in the book)
The explanation says:
„The class SubclassB declares the field objRefA of type SuperclassA at (1). The method subclassMethodB() has the formal parameter objRefB of type SubclassB. Access is permitted to a protected member of SuperclassA in packageA by a reference of the subclass, as shown at (2) and (3), but not by a reference of its superclass, as shown at (4) and (5). Access to the field superclassVarA and the call to the method superclassMethodA() occur in SubclassB. These members are declared in SuperclassA. SubclassB is not involved in the implementation of SuperclassA, which is the type of the reference objRefA. Hence, access to protected members at (4) and (5) is not permitted as these are not members of an object that can be guaranteed to be implemented by the code accessing them. Accessibility to protected members of the superclass would also be permitted via any reference whose type is a subclass of SubclassB. The previously mentioned restriction helps to ensure that subclasses in packages different from their superclass can access protected members of the superclass only in their part of the implementation inheritance hierarchy. In other words, a protected member of a superclass is accessible in a subclass that is in another package only if the member is inherited by an object of the subclass (or by an object of a subclass of this subclass)
My problem is the bold part. I'm no native speaker and I would be grateful if somebody could explain what the authors meant with this sentence.