bool
- Last UpdatedSep 05, 2024
- 1 minute read
This topic is about the bool data type.
Value syntax
true
false
Note: Values are case sensitive.
Description
Bool type represents a Boolean value.
-
The default value of the bool type is false.
-
Logical operations can be performed using Boolean logical operators.
-
The bool type is the result type of comparison operators. A bool type can also be a controlling conditional expression in the flow control statements.
Autocasting
Bool type supports autocasting for:
-
string, if in the correct input format; otherwise, it will raise an exception.
bool b=”true”; //b=true;