- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Relational Operators in Dart Programming
Relational operators are used in cases where we want to compare two operands. The result when we use a relational operator between two operands is always a Boolean value.
There are different types of relational operators present in Dart. In the table shown below all the relational operators present in dart are mentioned.
Let's take a case where we have two variables x and y, with values 20 and 30 respectively.
Consider the table shown below as a reference −
Operator | Description | Output |
---|---|---|
> | Greater than | x > y = false |
< | Less than | x < y = true |
>= | Greater than or equal to | x >= y = false |
<= | Less than or equal to | x <= y = true |
== | Equal to | x == y = false |
!= | Not equal to | x != y = true |
Let's make use of all these relational operators in dart.
Example
Consider the example shown below −
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
- Related Articles
- Arithmetic operators in Dart Programming
- Assignment operators in Dart Programming
- Bitwise operators in Dart Programming
- Null Aware Operators in Dart Programming
- Test type operators in Dart Programming
- Relational Operators in C++
- Java Relational Operators
- Relational Set Operators in DBMS
- Basic Operators in Relational Algebra
- Comments in Dart Programming
- Constructors in Dart Programming
- Enumerations in Dart Programming
- Functions in Dart Programming
- Immutability in Dart Programming
- Inheritance in Dart Programming

Advertisements