menu

Java Operators


1. Which of the following operators is used to compare two values for less than or equal to?

!=

==

>=

<=


2. Which of the following operators is used to test if a variable refers to the same object as another variable?

!=

==

<=

>=


3. Which of the following operators is used to perform a bitwise left shift operation?

<<

>>

&

|


4. What is the result of the expression "Hello" + "World"?

Hello World

HelloWorld

Hello+World

HelloWorld!


5. Which of the following operators is used to compare two values for not equal to?

!=

==

>=

<=


6. Which of the following is the correct operator for division?

+

-

*

/


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

1

0

1

0


8. Which of the following operators is used to increment a variable by 1?

+=

++

--

*


9. What is the result of the expression 10 % 3?

1

2

3

4


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

33

6

123

6