Here you can find the source of clearBit(int flag, int i)
public static final int clearBit(int flag, int i)
//package com.java2s; /*//from w w w. j a v a 2s. c o m * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ public class Main { /** * @return `flag' with bit `i' set to 0 */ public static final int clearBit(int flag, int i) { int bit = pow2(i); return (flag & bit) == 0 ? flag : flag ^ bit; } private static final int pow2(int n) { return 1 << n; } }