Java Boolean to Bit booleanToBit(boolean b)

Here you can find the source of booleanToBit(boolean b)

Description

boolean To Bit

License

Open Source License

Declaration

public static byte booleanToBit(boolean b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte booleanToBit(boolean b) {
        if (b)//from w w w.  j av  a  2 s.  co m
            return 1;
        else
            return 0;
    }
}

Related

  1. booleanToBit(final byte value, final int bitNbr, final boolean state)
  2. booleanToBitflags(boolean[] flags)