Article View: borland.public.jbuilder.java.language
Article #14946Re: Illogical constructor behaviour?
From: Tor Iver Wilhelmsen
Date: Tue, 20 Jul 1999 00:00
Date: Tue, 20 Jul 1999 00:00
19 lines
1305 bytes
1305 bytes
Tom.Eugelink@OVSoftware.com writes:
> private String something = "Hello world";
This is automagically moved (by the compiler) into the constructor:
After the call to super(), but before any other code you have there.
> Because which method is called if I define this variable as static?
The class (static) initializer, which you normally declare yourself
using
static {
}
(Basically, constructors are renamed to "<init>" and static
initializers to "<clinit>" - this is why you e.g. can have methods
with the same name as the class.)
Technical Details
Message-ID:
<u1ze3g3bj.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> <uhfn8aph8.fsf@sds.no> <378c7224.5379925@forums.inprise.com> <MPG.11f734ffaf88e14d989683@forums.inprise.com> <3792d12a.4122557@forums.inprise.com> <upv1osstw.fsf@sds.no> <379424a2.91026959@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/20 Message-ID: <u1ze3g3bj.fsf@sds.no> X-Deja-AN: 503044475 Sender: towi@SDSA1761 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> <3792d12a.4122557@forums.inprise.com> <upv1osstw.fsf@sds.no> <379424a2.91026959@forums.inprise.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language