🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #1785

Re: [java] dringend, ik krijg een rare null pointer exception.

#1785
From: H. J. Sander Bruggink
Date: Tue, 23 Nov 2004 23:09
38 lines
2413 bytes
Passero wrote:
> Dit is de code waar het zich in afspeelt:
> de constructor van mijn klasse:
> 
> public Boom(char[][] start)
>   {
>     root = new Knoop(copyArray(start));
>     laatste = root;
> 
>     System.out.println("laatste gezet");
>     if(laatste == null) System.out.println("laatste is null");
>   }
> 
> Daardoor zie ik duidelijk of het object laatste iets bevat want ik krijg de
> error dat laatste een null object is. Die error krijg ik op volgende regels:
> 
> public void voegToe(char[][] links, char[][] rechts)
>   {
>     laatste.setChildRechts(new Knoop(rechts));
>     laatste.setChildLinks(new Knoop(links));
>     laatste = laatste.getChildLinks();
>   }
> 
> Ik ben zeker dat links en rechts niet null bevatten want daar test ik op
> voor ik deze methode aanroep.
> 
> Waarom krijg ik dan toch deze error?
> 

Ik snap niet helemaal wat je probleem is, want in je tweede
stukje code wordt het eerste stukje code helemaal niet
aangeroepen.

Kortom: wat voor foutmelding krijg je precies, en hoe
verhouden die twee stukjes code zich tot elkaar?

groente
-- Sander
Technical Details
Message-ID: <co0fpq$iu7$1@dot.warande.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.zanker.org!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!131.211.141.196.MISMATCH!humbolt.nl.linux.org!news.nl.linux.org!phil.uu.nl!ruu.nl!warande.net!not-for-mail
References: <gnOod.33522$%86.1713265@phobos.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,71b2f18350b4e7b5
X-Google-Thread: 107324,71b2f18350b4e7b5
X-Google-Attributes: gidfcea4,gid107324,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.zanker.org!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!131.211.141.196.MISMATCH!humbolt.nl.linux.org!news.nl.linux.org!phil.uu.nl!ruu.nl!warande.net!not-for-mail
From: "H. J. Sander Bruggink" <bruggink.at.phil.uu.nl@no.spam.please>
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: Re: [java] dringend, ik krijg een rare null pointer exception.
Date: Wed, 24 Nov 2004 00:09:32 +0100
Organization: WarandeNet (http://www.warande.uu.nl)
Lines: 38
Message-ID: <co0fpq$iu7$1@dot.warande.net>
References: <gnOod.33522$%86.1713265@phobos.telenet-ops.be>
NNTP-Posting-Host: 185pc229.sshunet.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: dot.warande.net 1101251194 19399 131.211.229.185 (23 Nov 2004 23:06:34 GMT)
X-Complaints-To: abuse@warande.uu.nl
NNTP-Posting-Date: 23 Nov 2004 23:06:34 GMT
User-Agent: Mozilla Thunderbird 0.7.3 (Macintosh/20040803)
X-Accept-Language: en-us, en
In-Reply-To: <gnOod.33522$%86.1713265@phobos.telenet-ops.be>