The break statement cannot be used within a _______. 

  • function 
  • switch statement 
  • class 
  • if condition
The break statement is primarily used to terminate loops and switch statements. Using a break outside these constructs, like directly inside a function without a loop or switch, would result in a compilation error as it wouldn't have a clear context to operate within.
Add your answer
Loading...

Leave a comment

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