title: How to count the occurrence of each character in char array?
body: <p>I'm trying to count the occurrence of each character in an char array. How many times a specific lower case or upper case letter appears? What would be an effective method as I keep running in circles and into errors? </p>
  
  <p>This is the code I used to populate the array with random characters: </p>
  
  <pre><code>char[] chararray = new char[1000]; 
     for (int i = 0; i &lt; chararray.length; i++) { 
         char c = randomCharacter();
         chararray[i] = c;  
     }//end for  
  </code></pre>
  
  <p>I've tried creating a second array to count it for both upper and lower case such as, but I'm not sure what to do with it: </p>
  
  <pre><code>int[] counter = new int[52];
  </code></pre>
  
  <p>Any sort of help would be appreciated it. Thank you. </p>