🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17263

Re: class = null ?!

#17263
From: John P. McGrath
Date: Mon, 23 Nov 1998 00:00
24 lines
1260 bytes
Vladimir Olenin <keenonjava@collegemail.com> wrote:

>     Data d = B.getData();  // d == null, though d.field1 != null,
> d.field2 != null, etc
> 
> Is that normal or what? Thanks beforehand,

No, it is not normal, and not possible, according to the Java Language 
Specification.  If (d == null), then the expression (d.field1) does 
not have any meaning.  If the program tries to evaluate it, it will 
throw a NullPointerException

If you post the code that led you to believe this, preferably as a 
complete, minimal, working example, it will make it possible for 
someone to help you with your problem.  Actually, my experience has 
been that trying to create such an example usually results in figuring 
out the problem.

-- 
Regards,

John P. McGrath
<mcgrath@enter.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID: <MPG.10c2e89ecd46649598972f@forums.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36586170.A4A677D4@collegemail.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,6cc14c4eb4d410f7
X-Google-Attributes: gidf74b3,public
From: mcgrath@enter.net (John P. McGrath)
Subject: Re: class = null ?!
Date: 1998/11/23
Message-ID: <MPG.10c2e89ecd46649598972f@forums.inprise.com>
X-Deja-AN: 414731900
References: <36586170.A4A677D4@collegemail.com>
Organization: Software Consulting Services
Newsgroups: borland.public.jbuilder.java.language