title: Arrays-odds and evens to determine how many of the values in the array are odd and how many are even
body: <p>I'm trying to find the evens and odds of an array for practice.  </p>
  
  <p>Sample Data : </p>
  
  <pre><code>2 4 6 8 10 12 14
  1 2 3 4 5 6 7 8 9
  2 10 20 21 23 24 40 55 60 61
  </code></pre>
  
  <p>Sample Output : </p>
  
  <pre><code>Odds - []
  Evens - [2, 4, 6, 8, 10, 12, 14]
  
  Odds - [1, 3, 5, 7, 9]
  Evens - [2, 4, 6, 8]
  
  Odds - [21, 23, 55, 61]
  Evens - [2, 10, 20, 24, 40, 60]
  </code></pre>
  
  <p>And here is my code so far:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class OddsAndEvens
  {
      private static int countEm(int[] array, boolean odd)
      {
          int count = 0;
          int dum = 0;
          for(int i=0; i&lt; array.length; i++)
          {
              dum = array[i] / 2;
              if(dum == 0 )
              {
                  count++;
              }
          }
          return count;
      }
  
      public static int[] getAllEvens(int[] array)
      {
          int numberEvens=0;
          for(int i =0; i&lt;array.length; i++)
          {
              if(array[i]%2 ==0)
              {
                  numberEvens++;
              }
          }
  
          int[] evens  = new int[array.length - countEm(array,false)];
          int count=0;
          for(int i=0; i&lt;array.length; i++)
          {
              if(array[i]%2==0)
              {
                  evens[count] = array[i];
                  count++;
              }
          }
          return evens;
      }
  
      public static int[] getAllOdds(int[] array)
      {
          int numberEvens = 0;
          for (int i = 0; i &lt; array.length; i++)
          {
              if (array[i] % 2 == 0)
              {
                  numberEvens++;
              }
          }
          return null;
      }
  }
  </code></pre>
  
  <p>But I been getting errors in my output. These errors are the fact I am  getting zeros  in my output .
  I'm just starting out and I'm hoping anyone can help me. </p>