Java boolean into Int value code example
Example 1: java cast bolean to int
int result = myBooleanVar ? 1 : 0;
Example 2: java cast int to boolean
boolean result = (myBinaryInt == 1);
boolean result2 = (myNonBinaryInt >= 1);
int result = myBooleanVar ? 1 : 0;
boolean result = (myBinaryInt == 1);
boolean result2 = (myNonBinaryInt >= 1);