A

Admin • 828.03K Points
Coach

Q. What is the output of the Java program with Right Shift (Without Fill Zeroes)?

Code:
byte num = (byte)0b1111_1000;
System.out.print(num + ",");
num = (byte)(num >> 1);
System.out.print(num);
  • (A) -8, -16
  • (B) -4, -8
  • (C) -8, -4
  • (D) Compiler error
  • Correct Answer - Option(C)
  • Views: 15
  • 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.