Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34472
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Why is it called "default constructor"? |
| Date | 2016-06-04 16:20 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <nivd65$pnn$1@dont-email.me> (permalink) |
| References | <default-constructor-20160604183650@ram.dialup.fu-berlin.de> |
On 6/4/2016 1:39 PM, Stefan Ram wrote:
> When a constructor is implicitly declared, it often has no
> parameters and it often is called »default constructor«.
>
> »Default« means »used when something is missing«.
Like, for example, a constructor you didn't write. Every
class requires a constructor, so if you don't write one it is
missing.
> So, why is it called »default constructor«?
Because it's the constructor the compiler writes for you in
the event you fail to write any yourself.
--
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Why is it called "default constructor"? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-06-04 16:20 -0400 Re: Why is it called "default constructor"? Lew <lewbloch@gmail.com> - 2016-06-05 09:35 -0700
csiph-web