title: Sum of char array in Java
body: <p>I have a little trouble of calculating sum of elements in char array. I tried like this but it does not give what I expect: </p>
  
  <pre><code>int count1=0;
      char [] charArray1={1,2,35,0};
      for (int i =0; i&lt;charArray.length; i++){
  
          count1=count1+charArray1[i];
  
      }
  </code></pre>
  
  <p>I'm getting Exception: </p>
  
  <p>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 105
      at CountDigits.main(CountDigits.java:31)</p>
  
  <p>Any hint please?</p>