Operators in Java

1) What are operators and what are the various types of operators available in Java?

Ans: Operators are special symbols used in expressions.

The following are the types of operators:

Arithmetic operators,

Assignment operators,

Increment & Decrement operators,

Logical operators,

Biwise operators,

Comparison/Relational operators and

Conditional operators

hudihudi.com

2) The ++ operator is used for incrementing and the — operator is used for

decrementing.

a)True

b)False

Ans: a.

3) Comparison/Logical operators are used for testing and magnitude.

a)True

b)False

Ans: a.

hudihudi.com

4) Character literals are stored as Unicode characters.

a)True

b)False

Ans: a.

5) What are the Logical operators?

Ans: OR(|), AND(&), XOR(^) AND NOT(~).

6) What is the % operator?

Ans : % operator is the modulo operator or reminder operator. It returns the reminder of dividing the first operand by second operand.

hudihudi.com

7) What is the value of 111 % 13?

3

5

Ref Link contributor : http://www.hudihudi.com/placement/java/java11.htm

Permanent link to Java Tutorials / Java Interview Questions: http://www.freshersinterviewquestions.com/java-tutorials-operators