mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-20 21:42:14 +02:00
Added short explanation about break statement
This commit is contained in:
@@ -191,6 +191,8 @@ int i = 3;
|
|||||||
String value = (i > 5) ? "Big" : "Small"; // "Small"
|
String value = (i > 5) ? "Big" : "Small"; // "Small"
|
||||||
|
|
||||||
// Switch-case structure can be used to check multiple conditions concisely.
|
// Switch-case structure can be used to check multiple conditions concisely.
|
||||||
|
// It is important to use the break statement. If the `break`-statement does
|
||||||
|
// not exist the program executes all the following cases after a case was true.
|
||||||
int value = 2;
|
int value = 2;
|
||||||
switch(value) {
|
switch(value) {
|
||||||
case 0:
|
case 0:
|
||||||
|
Reference in New Issue
Block a user