Article View: borland.public.jbuilder.java.language
Article #14925Re: Illogical constructor behaviour?
From: Tom.Eugelink
Date: Mon, 19 Jul 1999 00:00
Date: Mon, 19 Jul 1999 00:00
32 lines
1913 bytes
1913 bytes
On Fri, 16 Jul 1999 05:11:29 +1000, dion@multitask.com.au (Dion Gillard) wrote: >In article <378c7224.5379925@forums.inprise.com>, >Tom.Eugelink@OVSoftware.com says... >| On 13 Jul 1999 11:06:11 +0200, Tor Iver Wilhelmsen >| <tor.wilhelmsen@sds.no> wrote: >| >| >Tom.Eugelink@OVSoftware.com writes: >| > >| >> Afterall, I did enter the constructor of the fireman class, so I feel >| >> that that is enough reason to have all instance variables not only >| >> allocated but also declared. >| > >| >No, because the language _specifies_ that the superclass constructor >| >is called first (all the way down to Object) before initialization of >| >fields happens. This is known behaviour. >| >| Well, then we can conclude that I do not agree with that >| specification, unless someone explains the reason for it to me. > >We can indeed conclude this. The reason is consistency. Why have two ways >to determine which method should be called, based on whether you're in >the super class' constructor or not? Ah, no. That is not what I mean with: when allocating instance variable memory also initialize instance variables, do not wait for the constructor to be entered. This does not result in two different ways, just in one another way. Tom
Technical Details
Message-ID:
<3792d12a.4122557@forums.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3789a7ea.1163072@forums.inprise.com> <uzp1241hv.fsf@sds.no> <378adee2.3105084@forums.inprise.com> <uhfn8aph8.fsf@sds.no> <378c7224.5379925@forums.inprise.com> <MPG.11f734ffaf88e14d989683@forums.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,c150801d0979e255 X-Google-Attributes: gidf74b3,public From: Tom.Eugelink@OVSoftware.com Subject: Re: Illogical constructor behaviour? Date: 1999/07/19 Message-ID: <3792d12a.4122557@forums.inprise.com> X-Deja-AN: 502632236 References: <3789a7ea.1163072@forums.inprise.com> <uzp1241hv.fsf@sds.no> <378adee2.3105084@forums.inprise.com> <uhfn8aph8.fsf@sds.no> <378c7224.5379925@forums.inprise.com> <MPG.11f734ffaf88e14d989683@forums.inprise.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language