title: Recursive method to count number of odd integers in array
body: <p>I need to write a recursive method to count the number of odd integers in an array.</p>
  
  <p>Here's my code so far:</p>
  
  <pre><code>public static int countOdd(int[] numbers, int startIndex, int endIndex) {
      if (startIndex == endIndex) {
          if (numbers[startIndex] % 2 != 0) {
              return 1;
          } else {
              return 0;
          }
      } else {
          return countOdd(numbers, startIndex, endIndex - 1);
      }
  }
  </code></pre>