+ 1
What is the difference between the switch statement and if-else statement in java?
6 Antworten
+ 13
Why don't you go through the Java tutorial, you've already started and you should read the COMMENTS in lessons because you can find excellent examples there.
https://code.sololearn.com/ciAHNcOTEBAq/?ref=app
+ 2
when you want to check an variable a lot of times a switch statment might be better, but the if-else if-statment can do the same.
+ 1
With the switch is more easier,it's good if you have to write more conditions.
0
classical switch is more readable but you must write break for each case. if can use more flexible conditions