English

The break statement may not be used in a switch statement. - Computer Applications

Advertisements
Advertisements

Question

The break statement may not be used in a switch statement.

Options

  • True

  • False

MCQ
True or False

Solution

This statement is False.

Explanation:

In a switch statement, the break statement is typically used to end one case and avoid "fall-through" to the next. Without a break, the code will continue to execute the next cases even if a match is obtained, which is typically undesirable. As a result, while the break statement is optional, it is commonly used in switch statements for control flow.

shaalaa.com
  Is there an error in this question or solution?
Chapter 1.08: Conditional Statements in Java - EXERCISES [Page 99]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.08 Conditional Statements in Java
EXERCISES | Q II. 5. | Page 99
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×