Boolean
Literals
Post
Boolean Literal
The boolean
basic type has only two values; boolean true is written as true
and boolean false is written as false
.
✍ Syntax
true
| false
Ballerina doesn’t support 0
, 1
or any other variations of true
or false
words as alternative syntax.
Code Breakdown
- Line 5: boolean literal
true
is assigned to the variableenable
. - Line 6: boolean literal
false
is assigned to the variableopen
.