Nested classes attributes’ visibility management
Nested classes attributes’ visibility management
Using Java we can declare several classes to be declared in a single source file, like nested classes. However, from the user’s perspective, they are regarded to belong to the “same class”. Thus, users assume that they have a shared access regime relative to their attributes. To sustain these assumptions, compilers should expand private attribute access to classes in the same package by incorporating access bridges. They assembled an invocation of a private member into a call of a compiler-generated method (getter) in the target class, which accesses the proposed private member.
Comments
Post a Comment