can anyone explain fallthrough?! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

can anyone explain fallthrough?!

24th Jun 2016, 11:59 AM
Ahmed Jaffer Elgassim
Ahmed Jaffer Elgassim - avatar
4 Answers
+ 3
fallthrough is used in switch in order to execute a case without checking its condition
24th Jun 2016, 9:53 PM
Ward Mas
Ward Mas - avatar
+ 2
fallthrough is used to execute multiple cases. for e.g if you are ib case 1 then in swift it will automatically return the control flow. but if you want to execute case 1 then case 2 then you have to write fallthrough at end of case 1
26th Jun 2016, 7:32 AM
Harshal Bhavsar
Harshal Bhavsar - avatar
+ 1
It just executes the line of code right below it.
30th Oct 2016, 10:57 AM
Pratham Patel
Pratham Patel - avatar
0
fallthrough is used for executing the immediate next case it's like anti break keyword. you can use fallthrough when you want multiple cases to get execute
30th Oct 2016, 11:10 AM
Harshal Bhavsar
Harshal Bhavsar - avatar