|
![]() |
#1 |
Registered User
Join Date: Sep 2015
Location: UK
Posts: 447
![]() |
The condition of a switch statement is a value. The case says that if it has the value of whatever is after that case then do whatever follows the colon. The break is used to break out of the case statements. Break is a keyword that breaks out of the code block, usually surrounded by braces, which it is in. In this case, break prevents the program from falling through and executing the code in all the other case statements. An important thing to note about the switch statement is that the case values may only be constant integral expressions.
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
What’s the purpose of using Break in each case of Switch Statement? | Shivangi Panwar | Java | 3 | 06-06-2016 10:40 PM |
Transfer Switch Market | Aadolf | General Discussion | 1 | 04-02-2016 02:04 AM |
Looking for a new case or cover to protect your new MacBook Air? | sophia21 | General Discussion | 0 | 10-31-2012 10:52 PM |
How to set up of custom html default error pages | jennypretty | Search Engine Optimization | 1 | 01-03-2012 09:21 AM |