Article View: borland.public.jbuilder.java.language
Article #8772Re: null value
From: Torsten Welches
Date: Sat, 03 Mar 2001 08:28
Date: Sat, 03 Mar 2001 08:28
24 lines
1369 bytes
1369 bytes
Stephen,
int is a primitive datatype, not a class. Only class types (references) can
have the special value null which is meant to be a "reference to nothing".
Simply check for the value zero:
stephen schrieb in Nachricht <3aa09b70_2@dnews>...
>How to get a int value and how to check if it is null?
>
>int RMBSum=Integer.parseInt(getParameter("RMBSum"));
>
>if ((RMBSum==null) && (RMBSum.intValue()==0))
> System.out.println("RMBSum null");
>else
> System.out.println(RMBSum);
>
>Thanks
>Stephen
>
>
>
>
>
>
Technical Details
Message-ID:
<3aa0ac15$1_2@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!195.14.254.80References:
<3aa09b70_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,1174403afea3aa39 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-03 00:41:49 PST From: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Newsgroups: borland.public.jbuilder.java.language References: <3aa09b70_2@dnews> Subject: Re: null value Date: Sat, 3 Mar 2001 09:28:59 +0100 Lines: 26 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 NNTP-Posting-Host: 195.14.254.80 Message-ID: <3aa0ac15$1_2@dnews> X-Trace: 3 Mar 2001 00:32:21 -0800, 195.14.254.80 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!195.14.254.80