Results 1 to 2 of 2
  1. #1
    Meta is offline Member
    Join Date
    Mar 2010
    Posts
    78
    Rep Power
    0

    Default Help with 2D Arrays.

    Im going to have two seprate 2D arrays. I know how to add the rows of a 2d array and i know how to add the columns of a 2d array, but i dont know how to do this.

    There are TWO 2D Arrays. I need to add the index of the first 2d array with the same index of the other 2d array, etc. for example:

    1 2 3
    1 2 3
    1 2 3

    +
    1 1 1
    1 1 1
    1 1 1
    =
    2 3 4
    2 3 4
    2 3 4

    but i have no clue!

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

    Default

    Use nested loops, with a loop over the rows and an inner loop over columns. Access the array entries using the indexes.
    The Java Tutorial. Read it.

Similar Threads

  1. Arrays.sort... why sorting all arrays in class?
    By innspiron in forum New To Java
    Replies: 6
    Last Post: 03-23-2010, 02:40 AM
  2. Arrays
    By HosHos in forum New To Java
    Replies: 3
    Last Post: 08-14-2009, 05:23 AM
  3. Please help me with arrays!
    By ddrcan in forum New To Java
    Replies: 2
    Last Post: 08-10-2009, 05:30 PM
  4. Help with arrays!
    By lilac87 in forum New To Java
    Replies: 2
    Last Post: 07-28-2009, 05:57 AM
  5. Need help with 2D arrays...
    By rrsv2 in forum New To Java
    Replies: 3
    Last Post: 11-30-2008, 04:15 AM

Posting Permissions

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