title: Convert int to char in java
body: <p>Below is a code snippet,</p>
  
  <pre><code>int a = 1;
  char b = (char) a;
  System.out.println(b);
  </code></pre>
  
  <p>But what I get is empty output.</p>
  
  <pre><code>int a = '1';
  char b = (char) a;
  System.out.println(b);
  </code></pre>
  
  <p>I will get 1 as my output. </p>
  
  <p>Can somebody explain this? And if I want to convert an int to a char as in the first snippet, what should I do?</p>