thumbnail

Equality and relational operators

Published on 29 March 2020
Last Updated on 29 March 2020

Table that describes various relational operators

Operator Description
!= not equal
== equal
< less than
> greater than
<= less than or equal to
>= greater than or equal to

Program about how to use relational operators in Dart

main(List<String> args) {
  print(1 != 2);
  print(1 == 2);
  print(1 < 2);
  print(1 > 2);
  print(1 <= 2);
  print(1 >= 2);
}

Above program produces following output:

true
false
true
false
true
false

The operator == can also be used for checking whether two objects are sa me or not.