A ladder means a vertical set of steps. It is a computer generated list of pairings used in eliminations.

Tutorials

A ladder means a vertical set of steps. It is a computer generated list of pairings used in eliminations.

In this example we are declaring a variable month of type String and initialize it with the value "January". We are using If- Else loop for the ladder. The loop will travel up to down and if the condition gets true then it will get out of the loop. We have defined the if- else condition inside the scriptlet. Scriptlet tag is used for the implementation of the business logic of the program.

The code of the program is given below:

 ``` Using an if-else Ladder ``` ``` Using an if-else Ladder <% String month = "January";``` ``` if(month == "January") out.println("It\'s January."); else if (month == "February") out.println("It\'s February."); else if (month == "March") out.println("It\'s March."); else if (month == "April") out.println("It\'s April."); else if (month == "May") out.println("It\'s May."); else if (month == "June") out.println("It\'s June."); else if (month == "July") out.println("It\'s July."); else if (month == "August") out.println("It\'s August."); else if (month == "September") out.println("It\'s September."); else if (month == "October") out.println("It\'s October."); else if (month == "November") out.println("It\'s November."); else if (month == "December") out.println("It\'s December."); %> ```

The output of the program is given below:

### Online Training Classes - 50% off on all classes for today

Related Tutorials

Subject (*):