title: Add bytes with type casting, Java
body: <p>I am trying to add two values in a byte array. This is my code:</p>
  
  <pre><code>byte[] ars = {3,6,9,2,4};
  ars[0] = (byte)ars[0] + (byte)ars[4];
  System.out.println( ars[0] );
  </code></pre>
  
  <p>I get this error on compilation:</p>
  
  <pre><code>Main.java:9: possible loss of precision
  found   : int
  required: byte
      ars[0] = (byte)ars[0] + (byte)ars[4];
                            ^
  1 error
  </code></pre>
  
  <p>Any help is, as always, much appreciated.</p>