Set Bit - Java Language Basics

Java examples for Language Basics:Bit

Description

Set Bit

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        byte _bitset = 2;
        byte bit = 2;
        SetBit(_bitset, bit);//from  ww w .java  2 s.c o  m
    }

    public static void SetBit(byte _bitset, byte bit) {
        _bitset |= bit;
    }
}

Related Tutorials