Here you can find the source of toDigit(final boolean bit)
Parameter | Description |
---|---|
bit | the boolean to interpret |
true
, 0 otherwise
public static int toDigit(final boolean bit)
//package com.java2s; public class Main { private static final int TRUE = 1; private static final int FALSE = 0; /**//from w ww .j a va2 s . c o m * Converts a boolean into a digit. * * @param bit * the boolean to interpret * @return 1, if bit was <code>true</code>, 0 otherwise */ public static int toDigit(final boolean bit) { return (bit) ? TRUE : FALSE; } }