5 years ago in Java Operators

What is the output of the program.
public class Test 

{

public static void leftshift(int i, int j)

{

i <<= j;

}

public static void main(String args[])

{

int i = 4, j = 2;

leftshift(i, j);

System.out.printIn(i);

}

}

[A] 2
[B] 4
[C] 8
[D] 16
Loading...
Next Question

Overall Stats

Attempted 250
Correct 54
Incorrect 81
Viewed 115

Answers

Guest
Guest
Vaibhav Bisht
Vaibhav Bisht - 4 weeks ago

Vaibhav Bisht from Dehradun, India is saying 16 is correct answer

Cos Sinus
Cos Sinus - 4 weeks ago

Cos Sinus from Casablanca, Morocco is saying 16 is correct answer

Zo Go
Zo Go - 4 weeks ago

Zo Go from Casablanca, Morocco is saying 2 is correct answer

AHMED SOULIMANI
AHMED SOULIMANI - 1 month ago

AHMED SOULIMANI from Casablanca, Morocco is saying 4 is correct answer

suman pandey
suman pandey - 1 month ago

suman pandey from Pune, India is saying 8 is correct answer

Related Questions