To prevent fall-through in a switch case, the ________ keyword is used after each case block.

  • break
  • continue
  • exit
  • return
To prevent fall-through in a switch case in Java, you use the break keyword after each case block. This ensures that once a case is matched and executed, the control exits the switch statement and doesn't fall through to subsequent cases.
Add your answer
Loading...

Leave a comment

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