Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    VinTiger is offline Member
    Join Date
    Feb 2009
    Posts
    32
    Rep Power
    0

    Default

    thanks everyone for all the help by the way. I find it a lot easier to understand this stuff learning from others than from books that overlook big parts of the learning process, and doesn't teach you much of the crucial basics.

  2. #22
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm hoping and praying that you'll learn to love and get benefit from the books too. In the end, they will prove much more efficient and less frustrating at helping you learn. Best of luck.

  3. #23
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    can I choose column 2 for instance within the brackets, such as [c1] or something like that?
    Yes - you can say phone[r][0]=... to put a name in the first column (column zero) and phone[r][1]=... to put a phone number in the second column.

    The name/number are now associated in the sense that they are both in row r.

    (I think that's what you were asking)

    Shouldn't the names and the numbers be stored in different columns in the program?
    Yes they should be. (But this doesn't mean that you have to populate the array with nested loops. You can, but you don't have to.

    Using phones[r][0]=... / phones[r][1]=... you can use a single for loop (which makes r run over the correct values) and within that loop set both column values.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 7
    Last Post: 09-27-2011, 12:29 AM
  2. two-dimensional array
    By kHim in forum New To Java
    Replies: 4
    Last Post: 11-16-2008, 08:21 PM
  3. Multi dimensional Array
    By Preethi in forum New To Java
    Replies: 1
    Last Post: 07-09-2008, 04:34 PM
  4. Replies: 2
    Last Post: 01-07-2008, 08:45 PM
  5. Help with array multi-dimensional
    By barney in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 09:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •