A

Admin • 830.13K 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
  • Correct Answer - Option(C)
  • Views: 17
  • Filed under category Java
  • Hashtags:

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.

Be the first to start discuss.