java type caste object to integer code example
Example 1: java cast bolean to int
int result = myBooleanVar ? 1 : 0;
Example 2: java string to integer
String example = "1";
int converted = Integer.parseInt(example);
int result = myBooleanVar ? 1 : 0;
String example = "1";
int converted = Integer.parseInt(example);