posted 21 years ago
Manfred, Thank you so much.
Now I think I know the ropes after ur kind explanation.
But I've got some supplement.
According to the JVM a protected variable can be accessed only if one of the following is true:
1. From within the class that declared it
2. From within any subclass of the class that declared it.
3. From the same package, right?
As far as my question is concerned, Q.class is not in the same package as Tester.class, so compile error occurs. If we put both of them in the same dir (import and package clause let out, of course), complier will not complain anymore.
In this circumstance, Number 3 is Okay.
Great thanks,
luco zhao
Great thanks,<br />Luco Zhao