Control Flow Statement
The purpose of the Dart Boolean data type is to determine the true or false value of a given statement. The two Boolean type values are true and false, which are both compile-time constants. In Dart, true or false cannot be specified using the numerical values 1 or 0. The Boolean value is represented by the bool keyword. The following is the syntax for declaring a Boolean variable.
bool var_name = true;
OR
bool var_name = false;
void main() {
bool check;
check = 20>10;
print("The statement is = ${check}");
}
true
The bool variable check, which will be used to validate the provided expression, has been declared. We printed the result when the expression 20>12 returned true.
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.