Here you can find the source of setBit(int number, int count)
public static int setBit(int number, int count)
//package com.java2s; //License from project: Open Source License public class Main { public static int setBit(int number, int count) { return number | 0x01 << count; }/* w w w. j av a 2s. co m*/ public static int setBit(int number, int count, boolean value) { if (value) { return setBit(number, count); } return clearBit(number, count); } public static int clearBit(int number, int count) { return number | 0x01 << count; } }