| Article: |
Nested Classes, Part 1 | |
| Subject: | Accessing Protected Members | |
| Date: | 2004-05-18 21:28:10 | |
| From: | bdell | |
|
Response to: Accessing Protected Members
|
||
|
I placed BasicMonitorScreen in package package1 and ColorMonitorScreen in package package2 and it still compiles. I also tried 1.4.2 and it works there as well. Perhaps I am misunderstanding what the "other" class is.
|
||
Showing messages 1 through 1 of 1.
-
Accessing Protected Members
2004-05-21 15:42:38 kristianmonsen [View]
I understand it so that if the enclosing class can access the variable, than the inner class can as well. Since the enclosing class is a subclass of the class where the variable is declared, it will always be able to access a protected variable.


