Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.21 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /** Returns how many numbers in the list are odd.
  2.  */
  3. public int areOdd(List<Integer> numbs) {
  4.         int count = 0;
  5.         for (int i = 0; i < numbs.size(); i++) {
  6.                 if (i % 2 != 0) {
  7.                         count++;
  8.                 }
  9.         }
  10.         return count;
  11. }