What is the correct syntax for static nested classes resp. why is the wrong syntax working in the one case and not working in the other case?
http://download.oracle.com/javase/tutorial/java/javaOO/nested.html says that static nested classes should be accessed this way:
OuterClass.StaticNestedCla开发者_JAVA百科ss nestedObject = new OuterClass.StaticNestedClass();
In my project I made a class declaration
class MyClass extends StaticNestedClass
(so I accessed the static nested class without the class name of the outer class) and this worked.
Then, I commited this to Subversion and checked this project out with another computer and then it didn't work. I had to access the StaticNestedClass with its full name (OuterClass.StaticNestedClass). Why does this work in the first case, but not in the second? And should it work or should it not work?
The only relevant difference is, that on the first computer I use eclipse Galileo and on the second one I use eclipse Helios. Both use the 1.6 compiler and by checking out the whole project with subversion the projects should be equal.
I checked it with different versions of eclipse (3.5.2, 3.6, 3.7). This wrong syntax only works in Galileo 3.5.2, so this problem belongs to eclipse and not to subversion, android or java.
精彩评论