Dart Logical operators

In this tutorial you will learn about the Dart Logical operators and its application with practical example.

Dart Logical Operators

Logical operators are used to combine expressions with conditional statements using logical (AND,OR,NOT) operators, which results in true or false. Let variable a holds true or 1 and variable b holds false or 0, then −

Dart Logical operators
Operator Name Description Example
&& Logical AND return true if all expression are true (a && b) returns false
|| Logical OR return true if any expression is true (a || b) returns true
! Logical NOT return complement of expression !a returns false

Example:-

When you run the above Dart program, you will see following output.

Output:-

dart_logical_operators

In this tutorial we have learn about the Dart Logical operators and its application with practical example. I hope you will like this tutorial.