title: Set specific bit in byte
body: <p>I'm trying to set bits in Java byte variable. It does provide propper methods like <code>.setBit(i)</code>. Does anybody know how I can realize this?</p>
  
  <p>I can iterate bit-wise through a given byte:</p>
  
  <pre><code>if( (my_byte &amp; (1 &lt;&lt; i)) == 0 ){
  
  }
  </code></pre>
  
  <p>However I cannot set this position to 1 or 0, can I?</p>