English

What is the effect of absence of break in SWITCH statement.

Advertisements

Question

What is the effect of absence of break in SWITCH statement.

Short Answer
Advertisements

Solution

In Java, the absence of a break statement in a switch statement causes fall-through. When a matching case is found, the program executes its statements and continues executing the statements of subsequent cases, regardless of whether their values match.

This process continues until a break statement or another control-flow exit is encountered, or the end of the switch block is reached.

shaalaa.com
  Is there an error in this question or solution?
Chapter 7: Statements and their Scope - EXERCISE [Page 164]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 7 Statements and their Scope
EXERCISE | Q 11. (i) | Page 164
Advertisements
Share
Notifications



      Forgot password?
Use app×