1) Code in the same package as the member's class; 2) Code in subclasses of the member's class
There's actually another part of the rule, difficult to explain in a few words, which says that if there were another class D in package dd which also extended A, then D could access x in objects of type D, but not in objects of type B or C.
But in any case, you're clearly looking for examples of classes that can't access x. If you create a class E in package cc, and E makes instances of A, B, and C, it can't access the x member in any of those objects.
whats ironic I protected is less protect than default(no access modifier)
if class A & B is in the same package and class C is a subclass of B then...
Class C CAN'T see things with default access in class B Class C CAN see things with with protect access in Class B
I know it backwards but it shows better intentionality..
it's far more useless to see the "protected" keyword and know that it can used by subclass of package classes, than for it to mean only package classes can use it