Results 1 to 2 of 2
  1. #1
    javagirl is offline Member
    Join Date
    Feb 2014
    Posts
    6
    Rep Power
    0

    Default Array - How to iterate through only the values greater than 0

    I have an 46x9 array. I only have 108 values in the array for which I need to perform preliminary computations. How do I get the read to only read the 108 values whose values are greater than 0 and skip the other 495 whose values are 0?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,501
    Rep Power
    5

    Default Re: Array - How to iterate through only the values greater than 0

    In spite of your slight miscalculation, you must iterate over all the values, ignoring the ones you don't want.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. Replies: 4
    Last Post: 11-02-2013, 10:58 PM
  2. Replies: 4
    Last Post: 11-02-2013, 10:58 PM
  3. Replies: 10
    Last Post: 05-08-2013, 12:39 PM
  4. Can only iterate over an array.... Miss understanding
    By KamikadZee in forum New To Java
    Replies: 1
    Last Post: 10-28-2011, 02:28 PM
  5. Replies: 14
    Last Post: 01-22-2011, 02:36 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
  •