Examveda
Examveda

What is the result of the expression 3 << 2 in Java?

A. 6

B. 9

C. 8

D. 12

Answer: Option C

Solution(By Examveda Team)

The correct answer is Option C: 8.

In Java, the expression 3 << 2 represents a left shift operation. In this case, the binary representation of 3 is shifted two positions to the left, resulting in 8 in decimal notation.

The binary representation of 3 is 0000 0011, and after a left shift of 2 positions, it becomes 0000 1100, which is 8 in decimal.

Therefore, the correct answer is Option C: 8.

This Question Belongs to Java Program >> Operators

Join The Discussion

Comments ( 2 )

  1. CHANDRAPRAKASH PRAJAPAT
    CHANDRAPRAKASH PRAJAPAT :
    3 weeks ago

    12 is correct answer

  2. Shaik Jareena
    Shaik Jareena :
    4 months ago

    12

Related Questions on Operators