Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25724 > unrolled thread
| Started by | Owen Jacobson <angrybaldguy@gmail.com> |
|---|---|
| First post | 2011-02-04 21:39 -0500 |
| Last post | 2011-02-04 21:39 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.java.programmer
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Why “new”? Owen Jacobson <angrybaldguy@gmail.com> - 2011-02-04 21:39 -0500
| From | Owen Jacobson <angrybaldguy@gmail.com> |
|---|---|
| Date | 2011-02-04 21:39 -0500 |
| Subject | Re: Why “new”? |
| Message-ID | <201102042139219025-angrybaldguy@gmailcom> |
On 2011-02-04 19:53:19 -0500, Lawrence D'Oliveiro said: > Java defines no meaning for “classname(args)” different from “new > classname(args)”. Not so. The former is parsed as a method call; the latter as a new-instance expression. Nothing, save good sense, prevents you from naming a method the same thing as a class (either the class containing it or some other class entirely). A better comparison would've been to languages like Python, where class creation is little more than another kind of function call (both syntactically and semantically), or to Smalltalk, where instance creation is defined somewhat independently for each class in the system via a class method (and "core" library classes like Object provide the real machinery via virtual class methods, something absent from Java). -o
Back to top | Article view | comp.lang.java.programmer
csiph-web