title: Char into byte? (Java)
body: <p>How come this happens:</p>
  
  <pre><code>char a = '\uffff'; //Highest value that char can take - 65535
  byte b = (byte)a; //Casting a 16-bit value into 8-bit data type...! Isn't data lost here?
  char c = (char)b; //Let's get the value back
  int d = (int)c;
  System.out.println(d); //65535... how?
  </code></pre>
  
  <p>Basically, I saw that a <code>char</code> is 16-bit. Therefore, if you cast it into a <code>byte</code>, how come no data is lost? (Value is the same after casting into an int)</p>
  
  <p>Thanks in advance for answering this little ignorant question of mine. :P</p>
  
  <p>EDIT: Woah, found out that my original output actually did as expected, but I just updated the code above. Basically, a character is cast into a byte and then cast back into a char, and its original, 2-byte value is retained. How does this happen?</p>