title: Returning the number of times a number appears in an Array?
body: <p>So I'm doing a bunch of exercises, one of them asks me to write a method that is passed an array with each slot type int. This method should return the number of times 99 occurs in the array. Here's what I came up with on the fly:</p>
  
  <pre><code>public static int countNum(int[]x)
  {
  int count = 0;
  for (int i = 0; i &lt;= x.length;i++);
  {
   if (x[i] == 99)
     count++;
  }
  return count;
  }
  </code></pre>
  
  <p>All in all, I just need to write the method. Am I on the right track?</p>