Article View: borland.public.jbuilder.java.language
Article #8712Re: Declaring an Array of Strings?
From: Dave Bird
Date: Thu, 08 Mar 2001 18:42
Date: Thu, 08 Mar 2001 18:42
32 lines
1879 bytes
1879 bytes
In<3aa6df5f$1_2@dnews>, Harry Whitehouse <harry@envmgr.com> writes:
>Hmmmm... This should be simple, but I get compiler errors:
>
> String AddressLine[];
You have declared that, in principle, AddressLine will be an array
of String objects. You have not actually allocated any array
storage to it. So you can't put anything into the elements,
of an array which doesn't exist yet. Try:
String AddressLine[] = new String[8];
>
> for(int i=0;i<7;i++)
> AddressLine[i]= new String; // line 208
0 1 2 3
123456789012345678901234567890123456 <-- it expects [] here?
>
>"Applet.java": Error #: 201 : '(' or '[' expected at line 208, column 36
>
>Can anyone clue me on this one?
--
^-^-^-@@-^-;-^ http://www.xemu.demon.co.uk/
(..)__u news:alt.smoking.mooses
Technical Details
Message-ID:
<hqA6vpAGK9p6EwO2@xemu.demon.co.uk>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!fr.clara.net!heighliner.fr.clara.net!grolier!dispose.news.demon.net!news.demon.co.uk!demon!xemu.demon.co.uk!daveReferences:
<3aa6df5f$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,9324d780b1c839d2 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-08 14:04:12 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!fr.clara.net!heighliner.fr.clara.net!grolier!dispose.news.demon.net!news.demon.co.uk!demon!xemu.demon.co.uk!dave From: Dave Bird <dave@xemu.demon.co.uk> Newsgroups: borland.public.jbuilder.java.language Subject: Re: Declaring an Array of Strings? Date: Thu, 8 Mar 2001 18:42:14 +0000 Organization: none Message-ID: <hqA6vpAGK9p6EwO2@xemu.demon.co.uk> References: <3aa6df5f$1_2@dnews> NNTP-Posting-Host: xemu.demon.co.uk X-NNTP-Posting-Host: xemu.demon.co.uk:158.152.196.209 X-Trace: news.demon.co.uk 984088976 nnrp-02:11955 NO-IDENT xemu.demon.co.uk:158.152.196.209 X-Complaints-To: abuse@demon.net MIME-Version: 1.0 X-Newsreader: Turnpike Integrated Version 5.00 U <dQumtnY$x4rJ2u5tL5fS$n2vuP> Lines: 32