simple bit operation for int to short
<p>Having trouble writing the bit operations to convert an int to a short depending on which 16 bits wanted, ex: 1 will be the left most 16 bits and 0 will be the right most 16. All help is appreciated!</p>

<pre><code>    /**
 * Get a short from an int.
 * 
 * Examples: 
 *     getShort(0x56781234, 0); // =&gt; 0x1234
 *     getShort(0xFF254545, 1); // =&gt; 0xFF25
 * 
 * @param num The int to get a short from.
 * @param which Determines which short gets returned - 0 for least-significant short.
 *            
 * @return A short corresponding to the "which" parameter from num.
 */
public static int getShort(int num, int which)
{

    if(which == 1){
        return num&gt;&gt;16;
    }
    else{
        return num &lt;&lt; 16;
    }
    }
</code></pre>

<p>I do not want to use >>> or &lt;&lt;&lt;</p>
