Article View: borland.public.jbuilder.java.language
Article #600Re: The static method readURL(String) from the type URLReader should
From: Kevin Dean [TeamB]
Date: Wed, 23 Mar 2005 19:45
Date: Wed, 23 Mar 2005 19:45
33 lines
1993 bytes
1993 bytes
scott wrote:
> //line below generates warning
> public String readURL(String url){
> String rc = "";
> try {
> rc = urlReader.readURL(url);
> } catch (MalformedURLException e){
> System.err.println(e.getMessage());
> }
> return rc;
> }
>
The warning is telling you that you are using an object to call a
static method; the object is redundant as static methods are usually
referred to through their class name. Try replacing the object with
the class name as follows and the warning should go away:
rc = URLReader.readURL(url);
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<xn0e03hxrhnuac001-kdean@www.teamb.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4240a17f$1@newsgroups.borland.com> <4240a90c@newsgroups.borland.com> <4241baaa$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,6574813dc04e4e07
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com>
Subject: Re: The static method readURL(String) from the type URLReader should
Newsgroups: borland.public.jbuilder.java.language
References: <4240a17f$1@newsgroups.borland.com> <4240a90c@newsgroups.borland.com> <4241baaa$1@newsgroups.borland.com>
Organization: Dolphin Data Development Ltd.
User-Agent: XanaNews/1.17.3.1
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr
p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
Message-ID: <xn0e03hxrhnuac001-kdean@www.teamb.com>
X-Ref: newsgroups.borland.com ~XNS:00000136
NNTP-Posting-Host: 24.57.153.235
Date: 23 Mar 2005 11:45:45 -0800
X-Trace: newsgroups.borland.com 1111607145 24.57.153.235 (23 Mar 2005 11:45:45 -0800)
Lines: 33
X-Authenticated-User: kdean
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail