+ 3
Where should i use switch? because i can accomplish my task with if elses.
is there any disadvantage of using switch instead of if elses, in java?
2 ответов
+ 3
I find switch easier to read and much faster to write, not sure how it affects performance.
+ 3
in if else we have to check every condition but in switch once the condition is checked it searches for the matching case