I am having a little trouble understanding the protected access modifier in java (or the design behind it). I thought it meant package access and access through objects that
Protected member in java
Same package-(it behaves like default)
It is accessible with in the sameclass,its child classes and also non child classes.(it behaves like default) You can even access protected members using parent or child reference.
Outside package-
It is accessible only to itz child class and the most important point here is that reference used must be of the same child class only