English

In a switch statement, why is it necessary to use break after each case? - Computer Applications

Advertisements
Advertisements

Question

In a switch statement, why is it necessary to use break after each case? 

Answer in Brief

Solution

  1. In a switch statement, the break statement terminates the block.
  2. If the break is not used, the control will keep on executing other cases under the switch block. 
shaalaa.com
  Is there an error in this question or solution?
Chapter 1.08: Conditional Statements in Java - Review Insight [Page 97]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.08 Conditional Statements in Java
Review Insight | Q 2. | Page 97
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×