Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 3
    good answer. accessing static members from instances is so illogical. it should only be possible to access static members via SomeClass.StaticMember or, inside SomeClass, via StaticMember (without this.) then we wouldn’t get these questions at all. Commented Sep 5, 2011 at 13:40
  • 6
    @Brandon: When you say "static nested class cannot invoke non-static methods or access non-static fields of an instance of the class within which it is nested." ... It means without creating an object of the enclosing class right? Since as i see it, nested static class is behaviorally a top-level class that has been nested in another top-level class for packaging convenience. So, should be possible to access non-static members via an object. Commented Apr 24, 2013 at 18:36