Updated on: August 31, 2022
Generally, an operator is used to manipulate a certain value or operand. An operator is used to perform some kind of mathematical and logical calculations on operands. In short, you can take it as an operator is used to operate the operands.
To learning in details best Java training institute in gurgaon
‘+’- it adds two operands
‘-‘- it helps in subtracting the second operand from the first
‘/’- it divides the numerator by the denominator
‘*’- it multiples two operands
%- it generate the output of the integer division
++- It increases an integer value by one
‘—‘- It decreases and integer value by one
|‘==’-It checks whether the two operands are equal or not. Statement will turn true if the operands are equal.|
‘===’-It finds the identical
‘!=’-Checks if two operands are equal or not. The condition sets true if the values are not equal.
‘!==’-It implies that the values are unidentical
‘>’-Checks if the value of the left operand is greater than the right one.
‘>=’-Checks if the value of the left operand is greater than or equal to the right one.
‘<’-This Checks if the value of the left operand is less than the value of the right operand
‘<=’-Checks if the value of the left operand is less than or equal to the value of the right operand
&: Boolean AND operation on each bit of its integer arguments
|: It performs a Boolean OR operation on each bit of its integer arguments
^:This operator performs Bitwise XOR operation
~: It is a unary operator and operates by reversing all the bits in the operand
<<: Moves all the bits in its first operand to the left by the number of places specified in the second operand.
>>: The left operand’s value is moved right by the number of bits specified by the right operand.
these are the operators that help in performing logical computations. The list includes.
&&: Logical AND – If both the operands are non-zero, then the condition becomes true
||: Logical OR – If any of the two operands are non-zero, then the condition is fine.
!: Logical NOT – Reverses the logical state of its operand.