English

Is it necessary to include default case in a switch statement? Justify. - Computer Applications

Advertisements
Advertisements

Question

Is it necessary to include default case in a switch statement? Justify. 

Answer in Brief

Solution

Yes. When no case is available for a given switch variable value, the 'default' case displays a message to the user indicating the incorrect decision. 

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

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.08 Conditional Statements in Java
EXERCISES | Q V. 3. | Page 100
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×