menu

Java Operators


1. Which of the following operators is used to perform a bitwise OR operation?

&

&&

|

||


2. Which of the following operators is used to perform a bitwise XOR operation?

&

&&

^

||


3.

What is the result of the expression 6 % 4?

2

0

1

4


4. Which of the following operators is used to compare two values for greater than?

!=

==

>=

>


5. What is the result of the expression 5 >= 5?

1

0

1

0


6. What is the result of the expression 3 * 2 + 5 / 2?

6.5

5.5

7

6


7. What is the result of the expression 1 + 2 + "3"?

33

6

123

6


8. What is the result of the expression 5 / 2?

2.5

2

3

2


9. Which of the following operators is used to decrement a variable by 1?

+=

++

--

*


10. What is the result of the expression true && false?

1

0

1

0