Home / CSE MCQs / JAVA MCQs :: Operators - Java

CSE MCQs :: JAVA MCQs

  1. Which right shift operator preserves the sign of the value?
  2. A.
    >>
    B.
    >>=

  3. Which of these statements are incorrect?
  4. A.
    The left shift operator, <<, shifts all of the bite in a value to the left specified number of times.
    B.
    The right shift operator, >>, shifts all of the bite in a value to the right specified number of times.
    C.
    The left shift operator can be used as an alternative to multiplying by 2.
    D.
    The right shift operator automatically fills the higher order bits with 0.

  5. What is the output of relational operators?
  6. A.
    Integer
    B.
    Boolean
    C.
    Characters
    D.
    Double

  7. Which of these is returned by greater than, <, and equal to, ==, operator?
  8. A.
    Integers
    B.
    Floating - point numbers
    C.
    Boolean
    D.
    None of the mentioned

  9. Which of the following operators can operate on a boolean variable?

     1. &&

     2. ==

     3. ?:

     4. +=

  10. A.
    3 & 2
    B.
    1 & 4
    C.
    1, 2 & 4
    D.
    1, 2 & 3

  11. Which of these operators can skip evaluating right hand operand?
  12. A.
    !
    B.
    |
    C.
    &
    D.
    &&

  13. Which of these statement is correct?
  14. A.
    true and false are numeric values 1 and 0.
    B.
    true and false are numeric values 0 and 1.
    C.
    true is any non zero value and false is 0.
    D.
    true and false are non numeric values.

  15. Which of these have highest precedence?
  16. A.
    ()
    B.
    ++
    C.
    *
    D.
    >>

  17. What should be expression1 evaluate to in using ternary operator as in this line? expression1 ? expression2 : expression3
  18. A.
    Integer
    B.
    Floating "“ point numbers
    C.
    Boolean
    D.
    None of the mentioned

  19. What is the order of precedence (highest to lowest) of following operators?

     1. &

     2. ^

     3. ?:

  20. A.
    1 -> 2 -> 3
    B.
    2 -> 1 -> 3
    C.
    3 -> 2 -> 1
    D.
    2 -> 3 -> 1