Here you can find the source of toInt(boolean flag)
flag ?
License
Open Source License
Parameter
Parameter Description flag The <code>boolean</code> to be converted to an <code>int</code>
Return
the value 1 if true
is passed, otherwise -1.
Declaration
public static int toInt(boolean flag)
Method Source Code
//package com.java2s;
//License from project: Open Source License
public class Main {
/**/*from w ww . j av a2 s. c o m*/
* This method is equivalent to <code>flag ? 1 : -1</code>.
*
* @param flag The <code>boolean</code> to be converted to an <code>int</code>
*
* @return the value 1 if <code>true</code> is passed, otherwise -1.
*/
public static int toInt(boolean flag) {
return flag ? 1 : -1;
}
}
Related