Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,043
    Blog Entries
    7
    Rep Power
    23

    Default Re: Comparing output of two arrays

    If your first loop terminates the 'index' variable has a value not less than 14 (so it's 14); you're using that index value just below that first loop, so kaboom! you get this AIOOB Exception.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  2. #22
    bad biddy is offline Member
    Join Date
    Mar 2012
    Posts
    51
    Rep Power
    0

    Default Re: Comparing output of two arrays

    How would i go about correcting the exception?

  3. #23
    bad biddy is offline Member
    Join Date
    Mar 2012
    Posts
    51
    Rep Power
    0

    Default Re: Comparing output of two arrays

    Friend told me to do this:

    you can use a single loop to compare the value at temp[count] to temp2[count].
    You can just use an if, elseif, else decision tree to print out the result of the comparison.

    Anyone have any suggestions on coding this?

    Thanks.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. comparing 2 arrays to see if they're equal
    By Get_tanked in forum New To Java
    Replies: 2
    Last Post: 02-17-2011, 07:59 AM
  2. Comparing Arrays in Java
    By Daykeem in forum New To Java
    Replies: 6
    Last Post: 01-15-2011, 05:25 AM
  3. Comparing arrays
    By mitty in forum New To Java
    Replies: 8
    Last Post: 04-14-2010, 11:55 AM
  4. Comparing two Char arrays
    By viperlasson in forum New To Java
    Replies: 3
    Last Post: 01-30-2010, 09:05 AM
  5. comparing arrays..
    By circuspeanuts in forum New To Java
    Replies: 5
    Last Post: 05-25-2009, 07:05 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
  •