how to convert boolean to int in java code example
Example 1: java cast bolean to int
int result = myBooleanVar ? 1 : 0;
Example 2: how to convert string to boolean in java
boolean bool = Boolean.parseBoolean(str);
int result = myBooleanVar ? 1 : 0;
boolean bool = Boolean.parseBoolean(str);