Dart Programming — Learning Operators.

Yogita Kumar
Level Up Coding
Published in
Oct 29, 2020

--

For evaluating any value you need to write a special kind of statement, this statement is called expression. Operands and Operators are the main elements of expression.

Operands represent data

Operator is a special kind of symbol that tells how the operands will be processed to generate the result.

e.g. 5+3 here 5 and 3 are operands and +(plus sign) is the operator.

and whole 5+3 is the expression.

In Dart you get the following types of operators :

  • Arithmetic Operators
  • Relational Operators
  • Bitwise Operator
  • Assignment Operator
  • Logical Operator
  1. Arithmetic Operators

Following are the arithmetic operators supported by Dart

Arithmetic Operators
Example for arithmetic operators

2. Relational Operators

Sometimes we need comparisons in two values in our program in that case relational operators are used. Relational operators always return a Boolean type of value i.e. true/false according to the result the next statement code gets executed.

Relational Operators
Example for Relational Operators

3. Bitwise Operators

During the evaluation of any expression, to increase the speed of computation expressions are converted into bit-level.

Bitwise Operators
Example for Bitwise Operators

4. Assignment Operators

Assignment operators are used to assign value to variables, and the best known assignment operator is =

Assignment Operators
Example for Assignment Operators

5. Logical Operators

Logical operators are used to combine the result of two expressions. It always returns a Boolean value true/false

Logical Operators
Example for Logical Operators

Thank You!

--

--

Google Developer Expert Flutter| Cloud Enthusiast | Full Stack Developer | .NET Developer |Coach and Trainer