Java switch statement compares the value and executes one of the case blocks based on the condition. It is same as if…else if ladder. Below are some points to remember while working with switch statements: case value must be of the same type as expression used in switch statement. case value must be a constant or literal. case values should be unique. If it is duplicate, then program will give compile time error. The break statement is used inside the switch to terminate a statement sequence. The break statement is optional. If omitted, execution will continue on into the next case.