A

Admin • 830.13K Points
Coach

Q. What is the output of the below Java program?

Code:
int persons = 45;
int random = 45;
switch(random)
{
case persons: System.out.print("CRICKET ");
default: System.out.println("RUGBY");
}
  • (A) CRICKET
  • (B) CRICKET RUGBY
  • (C) RUGBY
  • (D) Compiler error
  • Correct Answer - Option(D)
  • Views: 18
  • 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.