title: How to convert int to short int using bitwise operators?
body: <p>For example: </p>
  
  <pre><code>short a = 10;
  int b = a &amp; 0xffff;
  </code></pre>
  
  <p>Similarly if I want to convert from <code>int</code> to <code>short</code>, how do I do using bitwise operators? I don't want to use the usual casting using <code>(short)</code>.</p>