A

Admin • 831K Points
Coach

Q. What will be the output of the following Java program?

Code:
class leftshift_operator
{
public static void main(String args[])
{
byte x = 64;
int i;
byte y;
i = x << 2;
y = (byte) (x << 2)
System.out.print(i + " " + y);
}
}
  • (A) 0 64
  • (B) 64 0
  • (C) 0 256
  • (D) 256 0
  • Correct Answer - Option(D)
  • Views: 13
  • 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.