title: Why write() console output returns a character
body: <p>Meddling with the low level method write() in java and came across this confusing piece of code. </p>
  
  <pre><code>int b;
  
  b = 'X';
  System.out.write(b);
  </code></pre>
  
  <p>The method in its general documented form  would be<code>void write(int byteval)</code></p>
  
  <p>I understand byte and int can be assigned due to automatic type conversion but why does<code>write()</code> output characters despite being declared <code>int</code> ? I know its not commonly used but still curious why only the low-order 8 bits are written to allow this.</p>