- This type operators are use for comparation between two more variables.
Here, I have mentioned operator and their meaning and in last I have put example as well to better understand.
Operator Symbol | Operator Name | Operator Description |
> | Greater than | Check which operand is bigger and give result as boolean expression. |
< | Less than | Check which operand is smaller and give result as boolean expression. |
>= | Greater than or equal to | Check which operand is greater or equal to each other and give result as boolean expression. |
<= | less than equal to | Check which operand is less than or equal to each other and give result as boolean expression. |
\== | Equal to | Check whether the operand are equal to each other or not and give result as boolean expression. |
!= | Not Equal to | Check whether the operand are not equal to each other or not and give result as boolean expression. |
void main(){
var x = 20, y = 30;
print("x > y is: ${x > y}");
print("x < y is: ${x < y}");
print("x >= y is: ${x >= y}");
print("x <= y is: ${x <= y}");
print("x == y is: ${x == y}");
print("x != y is: ${x != y}");
}
/* Output
x > y is: false
x < y is: true
x >= y is: false
x <= y is: true
x == y is: false
x != y is: true
*/
ย