Operators
Operators
Jenishiya M
Operators are special symbols that
perform specific operations on
one, two, or three operands, and
Insert Your Image And Send To Back
2 ASSIGNMENT OPERATOR
3 RELATIONAL OPERATOR
4 TERNARY OPERATOR
5 BITWISE OPERATOR
6 LOGICAL OPERATOR
7 UNARY OPERATOR
8 SHIFT OPERATOR
Arithmetic Operator
ADDITION SUBTRACTION
MULTIPLICATION MODULUS
(+) (-)
(*) DIVISION
This is a binary
This operator is a (/)z operator that is used
This operator is a This operator is a binary This is a binary operator
binary operator to return the
binary operator operator that is used to divide the
and is used to remainder when the
and is used to add two and is used to multiply two first operand(dividend) by
subtract two the second
first
operands. operands. operands . operand(dividend) is
operand(divisor) and give divided by the second
the quotient as a result. operand(divisor).
.
Output:
ASSIGNMENT OPERATER
Addition
Subtraction
Multiplication
Division
Modulo
Output:
RELATIONAL OPERATOR
Relational operators like ==, != , >,
<, >=, and <= are key in Java for
comparing values, enabling the code
to make decisions and effectively
control the flow based on these
comparisons.
They are essential for implementing
logic in conditional statements and
loops.
Output:
Ternary Operator
Java ternary operator is the only conditional
operator that takes three operands.
It’s a one-liner replacement for the if-then-else
statement
15% and is used a lot in Java programming.
20%
60%
Output:
o In Java, an operator is a symbol that performs the
specified operations.
Bitwise o There are four types of bitwise operator in java.
o They are
1.Biwise AND
Opertor 2.Biwise exclusive OR
3.Biwise inclusive OR
4.Bitwise complement
Output:
Logical
Operator
Logical operators are used to
perform logical “AND”, “OR”
and “NOT” operations, i.e. the
function similar to AND gate
and OR gate in digital
electronics.
They are used to combine two
or more conditions/constraints
or to complement the
evaluation of the original !
condition under particular
consideration
Output:
• Java unary operators are the types that
need only one operand to perform any
operation like increment, decrement,
UNARY
negation, etc.
OPERATOR
Increment(++) And Decrement(--)
Post Increment
When placed after the variable name, the value of the
operand is incremented but the previous value is
retained temporarily until the execution of this Post decrement
statement and it gets updated before the execution of When placed after the variable name, the value of
the next statement. . the operand is decremented but the previous values
is retained temporarily until the execution of this
statement and it gets updated before the execution of
the next statement
Pre increment
When placed before the variable name, the operand’s
value is incremented instantly. Pre decrement
When placed before the variable name, the
operand’s value is decremented instantly.
Output:
By shifting the bits of its first operand right or
left, a shift operator performs bit manipulation on
SHIFT data.
The shift operators available in the Java
programming language are listed below.
OPERATOR The shift operator is a java operator that is used
to shift bit patterns right or left.