I\'m wondering if there\'s a way to convert a boolean to an int without using if statements (as not to break the pipeline). For example, I could write
int bo
A reasonable alternative to ising to the ternary to avoid an "if":
private static Boolean[] array = {false, true}; int boolToInt( boolean b ){ return Arrays.binarySearch(array, b); }
Note that I consider this s "puzzle" question, so if coding it myself i would use the ternary..