// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Bits {
   public static int bitset(int v, int no) {
      return (v | (1 << no));
   }
   public static int bitclr(int v, int no) {
      return (v & ~(1 << no));
   }
   public static int bitget(int v, int no) {
      return ((v >> no) & 1);
   }
   public static void main(String[] args) {
      System.out.println(bitget(100,6));
      System.out.println(bitset(0,6));
      System.out.println(bitclr(17,0));
   }
}
