posted 19 years ago
A few observations:
1. You can't have two public classes in the same file, which appears to be the case in your code.
2. If A is in one package and has a protected member, and B is in another package, then the protected member is visible to B only. On inheritance of a protected member from another package, that member becomes as though it were private in the subclass. Therefore, any class attempting to access the (now-private) member of the subclass will not be able to "see" the member.
Does that help clarify?
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4 all those years ago...)