Is there any reason why Java booleans take only true or false why not 1 or 0 also?
true
false
1
0
Even though there is a bool (short for boolean) data type in C++. But in C++, any nonzero value is a true value including negative numbers. A 0 (zero) is treated as false. Where as in JAVA there is a separate data type boolean for true and false.