title: Is Java char signed or unsigned for arithmetic?
body: <p>Java <code>char</code> is a 16 bit data type, but is it signed or unsigned when it comes to performing arithmetic on it?</p>
  
  <p>Can you use it as an unsigned 16 bit integer in arithmetic?</p>
  
  <p>For example, is the following correct?</p>
  
  <pre><code>char c1;
  char c2;
  
  int i = c1 &lt;&lt; 16 | c2;
  </code></pre>
  
  <p>Or is it necessary to strip the sign-extended bits off c2 first?</p>
  
  <p>(I am sure the answer to this is elsewhere, but there doesn't seem to be picked up by obvious searches).</p>