switch case | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

switch case

i can't understand without break statement in switch case.

24th Sep 2017, 3:04 PM
Shivani Goyal
3 Respostas
+ 6
The keyword break is used to exit the switch block, it tells the compiler to stop comparing values because a match for the case had been found, if you omit the break, compiler will continue processing the next case inside the switch block all the way through. Hth, cmiiw
24th Sep 2017, 3:13 PM
Ipang
24th Sep 2017, 3:34 PM
Peace Walker
Peace Walker - avatar
+ 2
Thanks a lot Ipang and =\ā€¢_ā€¢/=
14th Oct 2017, 5:50 PM
Shivani Goyal