Timeline for Java: Static vs inner class
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 1, 2016 at 21:08 | history | edited | Robert Harvey | CC BY-SA 3.0 | deleted 56 characters in body |
| Sep 30, 2015 at 15:56 | history | edited | LarsH | CC BY-SA 3.0 | gave reference to terminology definition, to clear up the confusion over whether and why there is such thing as a static inner class. |
| Apr 24, 2013 at 18:36 | comment | added | Shatu | @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. | |
| Sep 5, 2011 at 13:40 | comment | added | flying sheep | 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. | |
| Aug 30, 2009 at 7:45 | vote | accept | Abhishek Sanghvi | ||
| Aug 30, 2009 at 7:22 | history | answered | Brandon E Taylor | CC BY-SA 2.5 |