Q. What is the output of the Java program?

Code:
byte num = (byte)0b000_1000;
if(num >> 1 > 6 || true | 2>3)
{
System.out.print(num+1);
}
else
{
System.out.println(num>>2);
}
  • (A) 8
  • (B) 6
  • (C) 9
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 9

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
195
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
88%
Success Rate