Java Boolean Convert to boolean2byte(boolean b)

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

Description

booleanbyte

License

Open Source License

Declaration

public static byte boolean2byte(boolean b) 

Method Source Code

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

public class Main {
    public static byte boolean2byte(boolean b) {
        if (b) {//from  w  ww  .  j a v  a 2s. c o  m
            return 1;
        } else {
            return 0;
        }
    }
}

Related

  1. boolean2array(int sz, boolean seed)
  2. boolean2bin(boolean b)
  3. boolean2double(boolean b)
  4. boolean2long(boolean b)
  5. booleanArrayToBitString(final boolean[] booleanArray)
  6. booleanArrayToBytes(boolean[] input)