Nested Classes
I was hoping somebody could help me with regards to understanding nested classes. For the most part, I understand the access attributes among enclosing, inner, and static classes however, I am having trouble with one. It's shown in the diagram on p.210 in my book that instance members of a non-static nested class can access static members of a fellow static nested class within the same top level class. Yet when I try to demonstrate this with a dummy program, I get a 'cannot resolve symbol' error because the static variable in the static nested class is not recognized in the non-static class from which I attempt to access it. Just so it's clear, I'm not creating an object of the static class in the non-static one first, and then, using the dot operator, try to gain access to the static variable, i.e. staticNestedClassObject.staticVariable -- rather, i'm trying to use the variable directly in the non-static class by accessing it simply as staticVariable.
I was hoping somebody could enlighten me if i've miss understood something and perhaps post a small snipet of code for me to look at that would make things clearer.
Thanx in advance -- S.N.
|