+ 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?
3 Answers
+ 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