A switch statement allows the application to have multiple possible execution paths based on the value of a given expression in runtime.
The evaluated expression is called the selector expression which must be of type char, byte, short, int, Character, Byte, Short, Integer, String, or an enum.
In Java 14 a neat language feature was added, the switch statement was enhanced. Here is a simple example where I return a string based upon the specified Colour enum:
For more details on the enhanced switch statement, please see this excellent post.