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.

9
  • I have a basic understanding of the difference between a static (class) method and a non-static (instance) method. What I don't get is how it make sense for a class method to create an instance of its own type. Commented Oct 23, 2014 at 0:49
  • @flies: Why would it make any more or less sense than for any other method to create an instance of the type? Indeed, for factory methods (e.g. Integer.valueOf) that's the whole point of the method. Commented Oct 23, 2014 at 5:44
  • If class {...} defines a class, then how does it make sense for the definition to instantiate the thing being defined? It hasn't been defined yet, right? Commented Oct 24, 2014 at 2:34
  • @flies: It doesn't... it's not clear why you think it does... It's the static method (e.g. Integer.valueOf() that creates the instance. Commented Oct 24, 2014 at 5:47
  • the static method is part of the definition of the class, right? so the definition instantiates the thing defined? Commented Nov 11, 2014 at 16:54