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.

4
  • While this may technically be a static method using non-static data, it misses the point. Of course you can create a new instance and access it. But that has nothing at all to do with staticness. Commented Sep 11, 2013 at 16:17
  • 2
    Actually, I think this is a very good addition to explaining the point. It highlights the point that the static method needs an instance of the class before it can access non-static data while providing an intuitive reason why that is so. Commented Sep 12, 2013 at 3:23
  • @Bobson You should read the code and the comments also. Commented Sep 12, 2013 at 7:34
  • @BenHocking "yes" even i think it is good point telling that "instance variable is always associated with object" Commented Sep 15, 2013 at 3:16