R

Ram Sharma • 193.86K 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: 136
  • Filed under category JAVA

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.


Question analytics