set static method

int set(
  1. int n,
  2. int bit
)

Sets a bit in n at bit position bit.

Implementation

static int set(int n, int bit) {
  n |= (1 << bit);
  return n;
}