title: Question in regards to a line of the code
body: <p>In the below code snipped I have a  question, the given declared array is of type integer.Can you please explain on what is happening at the line map[s.charAt(i)]++. I am having trouble understanding the statement here as the array is of type integer during initialization, but character type are being given as input.</p>
  <pre><code>public int firstUniqChar(String s) 
  { 
  int[] map = new int[128]; 
  for(int i=0;i&lt;s.length();i++)
   map[s.charAt(i)]++; 
  for(int i=0;i&lt;s.length();i++) 
  if(map[s.charAt(i)] == 1) 
  return i; 
  return -1;
   }
  </code></pre>