title: Type casting into byte in Java
body: <p>I am a beginner in Java.  I came across a concept called Type Casting.
  I have the following snippet-</p>
  
  <pre class="lang-java prettyprint-override"><code>    class Demo
      {
          byte b;
          int a=257;
          double d= 323.142
          b=(byte)a;
            System.out.println(b);
          b=(byte)d;
            System.out.println(b);
  
      }
  </code></pre>
  
  <p>The output for the code is <code>1</code>
  <code>67</code></p>
  
  <p>Can anybody explain me the outputs.</p>
  
  <p>Thanks in Advance!</p>