Java12 introduced syntax changes to Switch statement, and can be used as Statement or expression in java.