Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34472

Re: Why is it called "default constructor"?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Why is it called "default constructor"?
Date Sat, 4 Jun 2016 16:20:16 -0400
Organization A noiseless patient Spider
Lines 18
Message-ID <nivd65$pnn$1@dont-email.me> (permalink)
References <default-constructor-20160604183650@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Sat, 4 Jun 2016 20:20:21 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="2d081e2f7155c28005d4472f67c2f43d"; logging-data="26359"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AXb8mHQvaDf9kDS0Nj6Hi"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
In-Reply-To <default-constructor-20160604183650@ram.dialup.fu-berlin.de>
Cancel-Lock sha1:nbPUqxT1gPTFtGD/7xQbOR5UaxE=
Xref csiph.com comp.lang.java.programmer:34472

Show key headers only | View raw


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


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