Dart: Operators

# Arithmetic Operators
+Add
-Subtract
-exprUnary minus, also known as negation (reverse the sign of the expression)
*Multiply
/Divide
~/Divide, returning an integer result
%Get the remainder of an integer division (modulo)
++Increment
--Decrement
# Equality and Relational Operators
<A Lesser than B(A < B) is True
>=A Greater than or equal to B(A >= B) is False
<=A Lesser than or equal to B(A <= B) is True
==A Equality B(A==B) is False
!=A Not equal B(A!=B) is True
# Type test Operators
isTrue if the object has the specified type
is!False if the object has the specified type
Bitwise ANDa & b
Bitwise ORa | b
Bitwise XORa ^ b
Bitwise NOT~ a
Left shifta ≪ b
Signpropagating right shifta ≫ b
# Assignment Operators
=(Simple Assignment )Assigns values from the right side operand to the left side operand
Ex:C = A + B will assign the value of A + B into C
??=Assign the value only if the variable is null
+=(Add and Assignment)It adds the right operand to the left operand and assigns the result to the left operand.
Ex: C += A is equivalent to C = C + A
-=(Subtract and Assignment)It subtracts the right operand from the left operand and assigns the result to the left operand.
Ex: C -= A is equivalent to C = C – A
*=(Multiply and Assignment)It multiplies the right operand with the left operand and assigns the result to the left operand.
Ex: C *= A is equivalent to C = C * A
/=(Divide and Assignment)It divides the left operand with the right operand and assigns the result to the left operand.
# Logical Operators
&&And − The operator returns true only if all the expressions specified return true
||OR − The operator returns true if at least one of the expressions specified return true
!NOT − The operator returns the inverse of the expression’s result.

Leave a Reply

Your email address will not be published. Required fields are marked *