🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Array of Strings: How?

#17782
From: Paul Gifford
Date: Thu, 01 Oct 1998 00:00
16 lines
777 bytes

  I want an array of strings.  Here's sample code:

  String names[] = new String[10];
  names[0] = new String("Bob Smith");

  Which is apparently the correct syntax according to "Java By
Example" (from Sun).  However, I get error "(37) ']' expected, with
the cursor positioned after "names[" on the 2nd line.

  What's my mistake?

TIA

p
Technical Details
Message-ID: <3613a7dc.5144351@forums.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,4bb9832368efc845,start
X-Google-Attributes: gidf74b3,public
From: paul.gifford@ibm.take.me.outta.here.net (Paul Gifford)
Subject: Array of Strings:  How?
Date: 1998/10/01
Message-ID: <3613a7dc.5144351@forums.inprise.com>
X-Deja-AN: 396731824
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language