No, switch statements are not generally used wrong . It’s more readable then a long if/else chain, compilers can emit very efficient code if the checked values are reasonably contiguous, and it’s easier to write error-checking compilers that warn you when you forget an alternative.
Read moreWhat is a switch in Java?
A Java switch statement is a multiple-branch statement that executes one statement from multiple conditions . The switch statement successively checks the value of an expression with a list of integer (int, byte, short, long), character (char) constants, String (Since Java 7), or enum types.
Read more