title: Count occurrence of integers in an array
body: <p>I have an integer array: <code>int[] numbers = new int[...n]; // n being limitless.</code></p>
  
  <p>Where all the numbers are between 0 and 100.</p>
  
  <p>Say <code>numbers[]</code> was equal to: <code>[52, 67, 32, 43, 32, 21, 12, 5, 0, 3, 2, 0, 0];</code></p>
  
  <p>I want to count how often each of those numbers occur. </p>
  
  <p>I've got a second array: <code>int[] occurrences = new int[100];</code>. </p>
  
  <p>I'd like to be able to store the amounts like such:</p>
  
  <pre><code>for(int i = 0; i &lt; numbers.length; i++) {
     // Store amount of 0's in numbers[] to occurrences[0] 
     // Store amount of 1's in numbers[] to occurrences[1]
  }
  </code></pre>
  
  <p>So that <code>occurrences[0]</code> would be equal to 3, <code>occurrences[1]</code> would be equal to 0 etc.</p>
  
  <p>Is there any efficient way of doing this without having to resort to external libraries? thanks.</p>