Article View: borland.public.jbuilder.java.language
Article #17303Re: class = null ?!
From: Vladimir Olenin
Date: Sat, 28 Nov 1998 00:00
Date: Sat, 28 Nov 1998 00:00
71 lines
3074 bytes
3074 bytes
This is a multi-part message in MIME format.
--------------7356ACF59D2F34ECD2D331BE
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
That is exactly what i meant. Thanx again.
Vladimir
"Steve Schafer (TeamB)" wrote:
>
> On Sat, 28 Nov 1998 00:20:41 +0300, Vladimir Olenin
> <keenonjava@collegemail.com> wrote:
>
> >Other days i figure the problem out. I've attached minimal code to this
> >letter. The problem was that when Data class (in the attached files it's
> >pack.class) had only static fields, then it was possible to intitialize
> >the fields only, without intitializing class. That's why pointer to that
> >class was null.
>
> To clarify the terminology: Static fields are associated with a class,
> while other "normal" fields are associated with an _instance_ of a
> class. In order to create an instance of that class, you have to use
> the "new" operator. You use the expression "pointer to that class,"
> but that's not correct. Your pointer was not a pointer to the class,
> it was a pointer to an _instance_ of that class. Since you had never
> used the "new" operator, no instance was ever created, and that's why
> the pointer was null. Because the static variables were associated
> with the class itself (which already existed), you could access them
> without any problem.
>
> By the way, it is possible to initialize a class itself; you can do
> this with a static initialization section:
>
> public class Foo {
>
> ...
>
> static {
> // class initialization goes here
> }
>
> }
>
> -Steve
--
>~~~~~~~~<=============>~~~~~~~~<
Be yourself no matter what they say...
Join in Java community now!
http://www.geocities.com/SiliconValley/Heights/9815
>~~~~~~~~<=============>~~~~~~~~<
--------------7356ACF59D2F34ECD2D331BE
Content-Type: text/x-vcard; charset=koi8-r;
name="keenonjava.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Vladimir Olenin
Content-Disposition: attachment;
filename="keenonjava.vcf"
begin:vcard
n:Vladimir;Olenin
x-mozilla-html:FALSE
adr:version:2.1;;;;;;
version:2.1
email;internet:keenonjava@collegemail.com
note:Java programmer. Open for project development offers. See my home page at: http://www.geocities.com/SiliconValley/Heights/9815/
end:vcard
--------------7356ACF59D2F34ECD2D331BE--
Technical Details
Message-ID:
<365F319C.1736DF53@collegemail.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36586170.A4A677D4@collegemail.com> <36798e4f.230406438@90.0.0.40> <365F17A9.129E7CE3@collegemail.com> <36a52049.310401141@90.0.0.40>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,6cc14c4eb4d410f7 X-Google-Attributes: gidf74b3,public From: Vladimir Olenin <keenonjava@collegemail.com> Subject: Re: class = null ?! Date: 1998/11/28 Message-ID: <365F319C.1736DF53@collegemail.com> X-Deja-AN: 416341409 References: <36586170.A4A677D4@collegemail.com> <36798e4f.230406438@90.0.0.40> <365F17A9.129E7CE3@collegemail.com> <36a52049.310401141@90.0.0.40> X-Accept-Language: en,ru Content-Type: multipart/mixed; boundary="------------7356ACF59D2F34ECD2D331BE" Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language