posted 21 years ago
Why are static inner classes referred to sometimes as nested top-level classes? I think it is just silly semantics. Someone probably, realized once that the below two code fragments would have exactly the same implementation if you pretend that the latter is a legal name. I can see the reasoning now: "Since in the implementation of an inner static class, the binary code doesn't need a pointer to an instance of the outer class, maybe we shouldn't call an inner static class inner at all, but rather nested top-level."
Fortunately, wiser heads prevailed and they mostly abandoned the semantic quibble, rather than pushing a confusing, yet meaningless to non-language-implementers, distinction.
below:
class outer {
static class inner {
}}
class outer {}
static class outer.inner {}