Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > initializing an array

Reply
Thread Tools

initializing an array

 
 
newby1
Guest
Posts: n/a
 
      07-03-2004
I have a program I must write which includes several items. I am using
an array and am having trouble initializing the array. I have a 2
dimensional array with 50 placeholders. How do I initialize without
listing all 50 spots?
Thanks,
Newby
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      07-03-2004
On 2 Jul 2004 20:45:53 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (newby1)
wrote or quoted :

>I have a program I must write which includes several items. I am using
>an array and am having trouble initializing the array. I have a 2
>dimensional array with 50 placeholders. How do I initialize without
>listing all 50 spots?


see http://mindprod.com/jgloss/gotchas.html#MATRIX

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
Sam
Guest
Posts: n/a
 
      07-03-2004
(E-Mail Removed) (newby1) wrote in message news:<(E-Mail Removed) om>...
> I have a program I must write which includes several items. I am using
> an array and am having trouble initializing the array. I have a 2
> dimensional array with 50 placeholders. How do I initialize without
> listing all 50 spots?
> Thanks,
> Newby


I guess you would need a nested loop for that.

Sam90
 
Reply With Quote
 
Hal Rosser
Guest
Posts: n/a
 
      07-04-2004
Arrays and loops go together like pb & J
for 2 dimensional array : use nested for loops

"newby1" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> I have a program I must write which includes several items. I am using
> an array and am having trouble initializing the array. I have a 2
> dimensional array with 50 placeholders. How do I initialize without
> listing all 50 spots?
> Thanks,
> Newby



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.712 / Virus Database: 468 - Release Date: 6/28/2004


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why no compiler-warning at invalid array-initializing ? carlos@gkpwdun.com Java 11 11-07-2005 08:34 PM
linkage error when initializing static member array Neno C++ 2 10-23-2004 10:15 AM
Problem initializing class with literal array! Pedro Miguel Carvalho C++ 3 10-21-2004 04:12 PM
Initializing a static const member array of a class type Steven T. Hatton C++ 1 04-19-2004 06:42 AM
initializing a const array in a class J. Campbell C++ 4 01-29-2004 03:45 AM



Advertisments