title: Why can I generate char beyond max value?
body: <p>Why does  the following code <strong>not</strong> generate an error?</p>
  
  <pre><code>System.out.println((char) 2147483647);
  </code></pre>
  
  <p>According to <a href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" rel="noreferrer">oracle datatypes</a>, the maximum size for a <code>char</code> is <code>65,535</code>.</p>
  
  <blockquote>
    <ul>
    <li>char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).</li>
    </ul>
  </blockquote>