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

    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
    Northern Virginia, United States
    Rep Power

    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.

    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Replies: 4
    Last Post: 11-02-2013, 11:58 PM
  2. Replies: 10
    Last Post: 05-08-2013, 12:39 PM
  3. 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
  4. Replies: 14
    Last Post: 01-22-2011, 03: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