Java – Use String in Switch Statement

Starting from Java 7 release you can now use a string in the switch statement. On the previous version we can only use number or enum in the switch statement. The code below give you a simple example on it.