JSP Java Tutorial

< HTML>
  
    Using an if-else Ladder
  
  
    

Using an if-else Ladder


    <%
        String day = "Friday";
        if(day == "Monday")
            out.println("It\'s Monday.");
        else if (day == "Tuesday")
            out.println("It\'s Tuesday.");
        else if (day == "Wednesday")
            out.println("It\'s Wednesday.");
        else if (day == "Thurssday")
            out.println("It\'s Thursday.");
        else if (day == "Friday")
            out.println("It\'s Friday.");
        else if (day == "Saturday")
            out.println("It\'s Saturday.");
        else if (day == "Sunday")
            out.println("It\'s Sunday.");
    %>