Is Any Bit Set - Java java.util

Java examples for java.util:BitSet

Description

Is Any Bit Set

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        byte _bitset = 2;
        byte bit = 2;
        System.out.println(IsAnyBitSet(_bitset, bit));
    }//from ww w  .  j a v  a2  s .  c  o  m

    public static boolean IsAnyBitSet(byte _bitset, byte bit) {
        return ((_bitset & bit) != 0);
    }
}

Related Tutorials