Here you can find the source of boolToNum(Boolean bool)
Parameter | Description |
---|---|
bool | Boolean value which needs to be converted to int value |
public static int boolToNum(Boolean bool)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww. ja v a 2 s . c om * Converts a Boolean value to int value<br> * * @param bool * Boolean value which needs to be converted to int value * @return int value correspoding to the boolean : 1 for true and 0 for * false */ public static int boolToNum(Boolean bool) { int num = 0; if (bool.booleanValue()) { num = 1; } return num; } }