Java Operators

Operators in java

A.  Arithmetic Operators

Operator Description
 +  Addition
 –  Subtraction
 *  Multiplication
 /  Division
 %  Modules
 ++  Increment
 —  Decrement

 

B.  Relational Operators

Operator Description
 ==  Check Equal
 !=  Check Not Equal
 >  Check Greaterthan
 <  Check Lessthan
 >=  Check Greaterthan or Equal
 <=  Check Lessthan or Equal

 

C.  Bitwise Operators

Operator Description
 ~  Unary bitwise complement
 &  Bitwise AND
 |  Bitwise inclusive OR
 ^  Bitwise exclusive OR
 <<  Signed left shift
 >>  Signed right sift
 >>>  Unsigned right shift

 

D. Logical Operators

Operator Description
 &&  Logical AND
 ||  Logical OR
 !  Logical NOT

 

E.  Assignment Operators

Operator Example
   =  z = x + y
 +=  x += y
 -=  x -= y
 *=  x *= y
 /=   x /= y
 %=  x %= y
 <<=  x <<= y
 >>=  x >>= y
 &=  x &= y
 |=  x |= y
 ^=  x ^= y

Leave a Reply

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