Convert bool To Byte - Android java.lang

Android examples for java.lang:Byte

Description

Convert bool To Byte

Demo Code


//package com.java2s;

public class Main {
    public static byte boolToByte(final boolean value) {
        return (byte) (value ? 0x1 : 0x0);
    }/*from  w w  w  . j ava2  s  .  c  o  m*/
}

Related Tutorials