Friday 31 January 2014

Operators in Java

An operator is a symbol which perform an operation

An operator is said to be unary, if it performs operation on single operand.
   Ex:
      int a = 10;
      a++;

An operator is said to be binary, if it performs operation on two operands
   Ex:
      int a=10, b=20;
      int c = a-b;

An Operator is said to be ternary if it perform operation on three operands
   Ex:
      int a = 10, b=20, c;
      c= (a>b) ? a : b;

Operators in java are divided into 4 major categories
   Logical
   Bitwise

otheroperators like (assignment, comma, etc.,)

More About primitive types                                                 Arithmetic Operators                                                 Home

No comments:

Post a Comment