Java Operator

Here are 10 essential multiple-choice questions on Java Operators, covering key concepts.

Last Updated :
Discuss
Comments

Question 1

What will be the output of the following expression?

Java
System.out.println(10 / 3);
  • 3

  • 3.33

  • 3.0

  • Compilation Error

Question 2

Which of the following is NOT a valid Java operator?


  • +=

  • &=


  • **

  • >>>


Question 3

What will be the output of this Java snippet?

Java
int a = 5;
System.out.println(a++ + ++a);


  • 11

  • 12

  • 10

  • 13

Question 4

What is the result of true && false || true && true?


  • true

  • false

  • Compilation Error

  • Runtime Error

Question 5

What will be the output of the following code?

Java
System.out.println(5 + "5");


  • 10

  • 55

  • Compilation Error


  • Runtime Error

Question 6

What will be the output of this bitwise operation?

Java
System.out.println(5 & 3);


  • 1

  • 2

  • 3

  • 5

Question 7

What will be the value of result after this code executes?

Java
int result = 10;
result += (result--) + (++result);


  • 30

  • 21

  • 22

  • Compilation Error


Question 8

What will be the output of the following code?

Java
System.out.println(10 >> 1);


  • 5

  • 20

  • 15

  • 0

Question 9

What will be the output of this ternary operation?

Java
int a = 10, b = 20;
int min = (a < b) ? a : b;
System.out.println(min);


  • 10

  • 20

  • Compilation Error

  • Undefined Behavior

Question 10

Which operator has the highest precedence in Java?

  • + (Addition)

  • && (Logical AND)

  • * (Multiplication)

  • = (Assignment)


There are 10 questions to complete.

Take a part in the ongoing discussion