 # Operators

## Operators in Java are special symbols to perform specific tasks on operands. Operators can be classified into the following types: arithmetical, relational, increment/ decrement, logical and assignment.Arithmetic operators are used to perform arithmetic operations, such as addition subtraction and multiplication. The arithmetic operators are of two types: unary operators and binary operators. The relational operators are used to compare two values and determine the relationship between them. The increment operator (++) adds 1 to operand’s value. The decrement operator (--) subtracts 1 from operand’s value. The logical operators are used to evaluate multiple conditions together as a single expression. The assignment operator is used to update the value of a variable.

To Access the full content, Please Purchase

• Q1

What are Arithmetic Operators?

Marks:2

There are 5 arithmetic operators.

i) + ii) – iii) * iv} division as / and v) remainder as %

• Q2

Name the binary operators.

Marks:2

The binary operators are

· Arithmetic Operators

· Assignment Operators

· Bitwise Operators

· Logical Operators

· Shift Operators

· Relational Operators

· Complement selection Operators

· Class member Operators and

· Conditional Operators

• Q3

Give three examples of bitwise operators used in Java.

Marks:2

(i) & (bitwise And)

(ii) ! (Bitwise OR)

(iii) ^ (bitwise exclusive OR also referred to as XOR)

• Q4

What are unary operators? Give some examples.

Marks:2

Operators that act on one operand are referred to as unary operators. Some examples are: ++ Increment Operator and –- decrement operator, && Address operator, * Indirection operator, + Unary plus, - unary minus, ! logical negation, _ bitwise compliment.