JSP Java


  
    Testing for Multiple Conditions
  
  
    

Testing for Multiple Conditions


    <%
        int temperature = 64;
        switch(temperature) {
            case 60:
            case 61:
            case 62:
                out.println("Sorry, too cold!");
                break;
            case 63:
            case 64:
            case 65:
                out.println("Pretty cool.");
                break;
            case 66:
            case 67:
                out.println("Nice!");
                break;
            case 70:
            case 74:
            case 75:
                out.println("Fairly warm.");
                break;
            default:
                out.println("Too hot!");
        }
    %>