Using Compound Statements : If « JSP « Java Tutorial






<HTML>
  <HEAD>
    <TITLE>Using Compound Statements</TITLE>
  </HEAD>

  <BODY>
    <H1>Using Compound Statements</H1>
    <%
        int value = 10;

        if(value > 0) {
            out.println("The number was positive.");                
            out.println("Absolute value of " + value + " = " + value);
        }
    %>
  </BODY>
</HTML>








23.6.If
23.6.1.Using the if Statement
23.6.2.Using Compound Statements
23.6.3.Nested if Statements
23.6.4.Using an if-else Ladder