Java Bits Convert to bitString(boolean value)

Here you can find the source of bitString(boolean value)

Description

Return a string representation of "0" or "1" as the value of a boolean.

License

Apache License

Parameter

Parameter Description
value A boolean to examine.

Return

The string "1" is the boolean is true and "0" if the boolean is false.

Declaration

public static String bitString(boolean value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*  w w  w. j a  v  a  2  s.co  m*/
     * Return a string representation of "0" or "1" as the value of a boolean.
     * @param value A boolean to examine.
     * @return The string "1" is the boolean is true and "0" if the boolean is false.
     */
    public static String bitString(boolean value) {
        return value ? "1" : "0";
    }
}

Related

  1. bitsToBase64(byte data)
  2. bitsToDouble(String bits, double min, double max, int splits)
  3. bitsToFloats(boolean[] b)
  4. bitsToTransform(int src, int target)
  5. bitStr(long value)
  6. bitString(byte b)
  7. bitString2byte(String str)
  8. bitStringToInt(String bits, char one)
  9. bitsUsed(long value)