@@ -0,0 +1,697 @@
+%0Apublic class StringSwitch %7B%0A%0A%09public static void main(String ...args) %7B%0A%09%09int colorCode = getColorCode(%22red%22);%0A%09%09System.out.printf(%22%25X%5Cn%22, colorCode);%0A%09%7D%0A%09%0A%09/**%0A%09 * Method to convert a String value like %22Red%22, %22Green%22 or %22Blue%22 to the correpsonding %0A%09 * HTML color code. %0A%09 * @param color the color name%0A%09 * @return the html color code%0A%09 */%0A%09static int getColorCode(String color) %7B%0A%09%09int colorCode = 0x0;%0A%09%09if (color == null) %7B%0A%09%09%09return colorCode;%0A%09%09%7D%0A%09%09switch (color.toLowerCase()) %7B%0A%09%09case %22red%22:%0A%09%09%09colorCode = 0xFF0000;%0A%09%09%09break;%0A%09%09case %22green%22:%0A%09%09%09colorCode = 0x00FF00;%0A%09%09%09break;%0A%09%09case %22blue%22:%0A%09%09%09colorCode = 0x0000FF;%0A%09%09%09break;%0A%09%09default:%0A%09%09%09colorCode = 0x0;%0A%09%09%7D%0A%09%09return colorCode;%0A%09%7D%0A%7D%0A

Create StringSwitch.java