<< §3.5.(d) Effect | ↑ Table of Contents ↑ | §3.5.(f) Shorthand definition >> |
§3.5.(e) Access control
For accessing an otherwise invisible field, the rules for
decapsulation (§3.4) apply accordingly.
Recall, that according to
JLS §8.3
fields may be hidden in sub-classes of a given base class. Therefore, it is relevant to know that a callout to
a field will always access the field that is visible in the exact base
class of the role class defining the callout. This is especially relevant
for accessing private fields.
<< §3.5.(d) Effect | ↑ Table of Contents ↑ | §3.5.(f) Shorthand definition >> |