title: Why int a = 5 - '0'; is possible in java?
body: <pre><code>   public static void main( String... args){
          int a = 5 - '0';
          System.out.println(a);  //-43
          Integer b = 5 - '0';
          System.out.println(b);  //-43
          System.out.println(Integer.valueOf(a)); //-43
          System.out.println(String.valueOf(b));  //-43
      }
  </code></pre>
  
  <p>So I have two questions for this code.</p>
  
  <ul>
  <li>Why <code>int=5-'0';</code> is possible?? <code>5</code> is an int which is ok but next to that is a character than why it's not throwing any error??</li>
  <li>Is it the ASCII value of result? than how result will be calculated?</li>
  </ul>
  
  <p>I know ASCII value of <code>43</code> is <code>+</code> but is it will convert <code>'0'</code> to it's ASCII and then do the operation?</p>