Posts Tagged: switch-case in java

Use of Switch-Case in Java?

The switch case statement is useful when selecting some action from a number of alternatives. The value inside the test expression must be a int, char, short or byte. It can not be a long, double, float, string or any other other kind of object.The switch statement allows for any number of possible execution path.
The body of a switch statement is known as a switch block.