Dart Operators : Logical

Dart Operators : Logical

ยท

1 min read

  • This operator is use more to combine two more condition.

  • In below table you can see their symbol and use .

Operator SymbolOperator NameOperator Description
&&And OperatorUse to add two conditions and if both are true than it will return true.
!Not OperatorIt is use to reverse the result.
void main()
{
    int a = 5;
    int b = 7;

    // Using And Operator
    bool c = a > 10 && b < 10;
    print(c); //fasle

    // Using Or Operator
    bool d = a > 10 || b < 10;
    print(d);//true

    // Using Not Operator
    bool e = !(a > 10);
    print(e);//true
}
ย