Here you can find the source of bit(int a, int b)
static int bit(int a, int b)
//package com.java2s; //License from project: Open Source License public class Main { static int bit(int a, int b) { return (a & (1 << b)) >> b; }//from w w w . ja v a 2 s. c om }