0

Compare the if statement and switch statement .

26th Mar 2017, 7:47 PM
Zeyad Sharo
Zeyad Sharo - avatar
2 Answers
+ 2
In addition to the other answer, you can have complex if conditions (e.g. checking multiple variables), but a switch limits you to the domain of the type you're switching on.
26th Mar 2017, 11:51 PM
Squidy
Squidy - avatar
+ 1
The switch statement in essence is a more consice and readable way to define multiple if-else blocks
26th Mar 2017, 8:02 PM
Logan New
Logan New - avatar