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
otheroperators like (assignment, comma, etc.,)
No comments:
Post a Comment