Article View: borland.public.jbuilder.java.language
Article #15029Re: Illogical constructor behaviour?
From: Tor Iver Wilhelmsen
Date: Tue, 13 Jul 1999 00:00
Date: Tue, 13 Jul 1999 00:00
13 lines
1124 bytes
1124 bytes
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. But the _type_ of the object will still be the subclass, so that's version of a method will be called even if a "lower" constructor invokes a method it assumes (wrongly) is its version.
Technical Details
Message-ID:
<uhfn8aph8.fsf@sds.no>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3789a7ea.1163072@forums.inprise.com> <uzp1241hv.fsf@sds.no> <378adee2.3105084@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: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no> Subject: Re: Illogical constructor behaviour? Date: 1999/07/13 Message-ID: <uhfn8aph8.fsf@sds.no> X-Deja-AN: 500445837 Sender: towi@SDSA1761 References: <3789a7ea.1163072@forums.inprise.com> <uzp1241hv.fsf@sds.no> <378adee2.3105084@forums.inprise.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language