English

Explain the term in relation to SWITCH: Default

Advertisements

Question

Explain the term in relation to SWITCH:

Default

Explain
Advertisements

Solution

In Java, the default label is used within a switch statement to specify a block of statements that is executed when none of the case labels match the value of the switch expression. The default block is optional and is generally used to handle unmatched values.

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

APPEARS IN

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



      Forgot password?
Use app×