Friday, 6 July 2012

Operators and its types

Operators and its Types

It refers as an operator is a symbol which is performing an operation .


Three categories of  operators

  1. Unary operator
  2. Binary operator
  3. Terinary operator

Unary operator is one operator and one operand only

Example: -X("-" is operator and "x" is a operand)

Binary operator is one operator and two operand

Example: x+y("+ "is operator and "x,y" is a operand)

Terinary operator is two operators and three operands

Example: (a>b)?a:b;("?,:" are operator and (a>b),a,b are operands)

Types of Operation

Java Supporting types of operators.They are
  • Assignment operator------------------------------------> "="
  • Arthmetic operator--------------------------------------> "-,+,*,/,%,++"
  • Relation operators/comparision operators--------> ">,<,>=,<=,==,!="
  • Logical operator/Boolean operator------------------>"&&,||,&,|,!,^"
  • Bit wise operator----------------------------------------->"&,|,^,<<,>>"
  • Compound Assignment operators--------------------> "+=,-=,*=,/=,%=,<<=,>>="
  • Conditional operatos/ternary operators------------>"?,:"