Is Bit Set - Java java.util

Java examples for java.util:BitSet

Description

Is 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(IsBitSet(_bitset, bit));
    }//from www. j ava2 s  .  c o  m

    public static boolean IsBitSet(byte _bitset, byte bit) {
        return ((_bitset & bit) == bit);
    }
}

Related Tutorials