【Java学习】-protected
If you created a new package and inherit from a class in another package, the only members you have access to are the public members of the original package.
Sometimes the creator of the base class would like to take a particular member and grant access to derived classes but not the world in general. That's what protected does. protected also gives package access--that is, other classes in the same package may access protected elements.

浙公网安备 33010602011771号