Friday, 15 December 2017

Operators in Java

Operators in Java


Operators are the symbols which are use to perform operations in Java program like +,-,/,* etc...

Types of Operator:

  1. Arithmetic operator
  2. Relational operator
  3. Logical operator
  4. Bitwise operator
  5. Assignment operator
  6. Shift operator
  7. Ternary operator
  8. Unary operator

Here we have the symbol orientation of Operators:



Operator NameSymbol
Unaryx++(post Increment), ++x(Pre Increment)
x--(Post decrement), --x(Pre decrement)
Arithmetic(+, -, *, /, %)
Shift<<, >>
Relational<, >, <=, >=, ==, !=
Bitwise&, ^, |
Logical&&, ||
Ternary? :
Assignment=

 

Arithmetic Operator Example:



Unary Operator Example:



Shift Operator Example:



Relational Operator Example:



Bitwise and Logical Operator:

0 comments:

Post a Comment