How can one read an integer bit by bit in Java?
<p>I would like to take an int as input, and return the kth bit.</p>

<pre><code>int getBit(int n, int k){
    return kth bit in n;
}
</code></pre>

<p>How would i do this?</p>
