Q. What is the output of the Java code snippet?

Code:
int a=6, b=5;
if(++b == a--)
{
  System.out.println("RABBIT");
}
else
{
  System.out.println("BUNNY");
}
  • (A) RABBIT
  • (B) BUNNY
  • (C) Compiler error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) RABBIT

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
263
Total Visits
πŸ“½οΈ
5 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
90%
Success Rate