Home / Programming MCQs / JAVA MCQs / Question

R

Ram Sharma • 189.43K Points
Coach

Q. What is the output of Java program with Right Shift Operator (>>)?

Code:
byte b = 0b00000101;
System.out.print(b + ",");
b = (byte)(b >> 1);
System.out.print(b);
(A) 5,-6
(B) 5,10
(C) 5, 2
(D) Compiler error

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.