Results 1 to 3 of 3

Thread: Nested Loop

  1. #1
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

    Default Nested Loop

    I am having a problem with a nested loop:

    Java Code:
            for(int rx=0; rx<matrixListArray.length; rx++){
                  System.out.println("RX: "+rx);
    
               for(int n=0; n<matrixListArray[rx].size(); n++){
                  System.out.println("RX: "+rx);
               System.out.println("******Minor Matrix List "+rx+"*******");
               System.out.println("Element "+n+": ["+matrixListArray[rx].get(n)+"]");
               }
           }
    It doesn't have as much to do with the code as it does me not understanding the loop ( i guess). The FIRST time I drop into the 2nd loop

    System.out.println("RX: "+rx);


    shouldnt I be getting a 0 back??? I am getting RX: 1

  2. #2
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

    Default

    answered my own question again....

  3. #3
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Haha, mark it solved with the thread tools if you solved it.

Similar Threads

  1. Issue with nested for loop
    By sunshine64 in forum New To Java
    Replies: 5
    Last Post: 02-03-2011, 02:45 AM
  2. Nested For Loop algorithm
    By but43r in forum Advanced Java
    Replies: 5
    Last Post: 01-11-2011, 08:52 AM
  3. can some one help me with nested loop?
    By keycoffee in forum New To Java
    Replies: 10
    Last Post: 01-25-2010, 02:49 AM
  4. nested for loop question
    By javabob in forum New To Java
    Replies: 3
    Last Post: 05-20-2008, 11:00 PM
  5. Nested For Loop
    By yuchuang in forum New To Java
    Replies: 1
    Last Post: 07-08-2007, 01:11 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
  •