multiple-choice questions (MCQs) on operators in Java:

1) Which of the following is a relational operator in Java?

  1. +
  2. =
  3. ==
  4. &&

Answer: c

Explanation: The relational operator in Java is used to compare two values. The == operator is used to check if two values are equal or not.

2) Which of the following operators is used to perform addition in Java?

  1. +
  2. *
  3. /

Answer: a

Explanation: The + operator is used to perform addition in Java.

3) Which of the following operators is used to perform division in Java?

  1. %
  2. &
  3. |
  4. /

Answer: d

Explanation: The / operator is used to perform division in Java.

4) Which of the following is a logical operator in Java?

  1. ++
  2. /
  3. &&
  4. =

Answer: c

Explanation: The logical operator in Java is used to perform logical operations such as AND, OR, and NOT. The && operator is used to perform the logical AND operation.

5) Which of the following is a unary operator in Java?

  1. +
  2. /
  3. *

Answer: c

Explanation: The unary operator in Java is used to operate on a single operand. The – operator is used to perform negation or change the sign of a value.

6) Which of the following operators has the highest precedence in Java?

  1. +
  2. /
  3. ++
  4. &&

Answer: c

Explanation: The increment operator (++) has the highest precedence in Java

7) Which of the following operators is used to perform modulo division in Java?

  1. /
  2. %
  3. *
  4. &

Answer: b

Explanation: The % operator is used to perform modulo division in Java.

8) Which of the following operators is used to perform bitwise AND in Java?

  1. &
  2. &&
  3. |
  4. ^

Answer: a

Explanation: The & operator is used to perform bitwise AND in Java.

9) Which of the following operators is used to perform equality comparison in Java?

  1. =
  2. ==
  3. !=
  4. >

Answer: b

Explanation: The == operator is used to perform equality comparison in Java.

10) Which of the following operators is used to perform bitwise OR in Java?

  1. |
  2. ^
  3. &
  4. ||

Answer: a

Explanation: The | operator is used to perform bitwise OR in Java.

thank you………………

Leave a Reply