Home
MCQs
Java MCQs
Operators
Java MCQs

Java MCQs - Operators

There are many operators in Java to manipulate operations on variables. You may find groups of operators such as Arithmetic Operators, Relational Operators, Bitwise Operators, Logical Operators, Assignment Operators and Ternary Operators.

1. Which are the unary operators ?

A. ++

B. --

C. Both of above

Answer: C

2. Which are the arithmetic operators ?

A. * / %

B. + -

C. All of above

Answer: C

3. Which are the Shift operators ?

A. >>>

B. >>

C. <<

D. All of Above

Answer: D

4. Which are the relational operators ?

A. < <=

B. > >= instanceof

C. == !=

D. All of Above

Answer: D

5. Which are the bitwise operators ?

A. &

B. ^

C. |

D. All of Above

Answer: D

6. Which are the logical operators ?

A. &&

B. ||

C. All of above

D. None of Above

Answer: C

7. Which are the ternary operators ?

A. ? :

B. ++

C. All of above

Answer: A

8. Which are the assignment operators ?

A. = += -= *= /= %=

B. &= ^= |=

C. <<= >>= >>>=

D. All of Above

Answer: D

9. What is the right output of this program ?

A. 6765

B. 5654

C. 5775

D. 5765

Answer: C

10. What is the right output of this program ?

A. 4,32

B. 32,4

C. 16,4

D. 4,16

Answer: B