In a switch case, the ________ keyword is used to specify the code that should be executed if no case matches.

  • default
  • defaultcase
  • else
  • fallback
In a switch case in Java, the default keyword is used to specify the code that should be executed if none of the case labels match the switch expression. It acts as a fallback or default option when no other case matches the switch expression.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *