JSP Java Tutorial

< HTML>
  
    Incrementing and Decrementing
  
  
    

Incrementing and Decrementing


    <%
        int int1 = 0, int2 = 0;
        out.println("int1 = " + int1 + "
");
        out.println("int2 = " + int2 + "
");
        int2 = int1++;
        out.println("After int2 = int1++:" + "
");
        out.println("int1 = " + int1 + "
");
        out.println("int2 = " + int2 + "
");
        int value3 = 0, value4 = 0;
        out.println("
");
        out.println("value3 = " + value3 + "
");
        out.println("value4 = " + value4 + "
");
        value4 = ++value3;
        out.println("After value4 = ++value3:" + "
");
        out.println("value3 = " + value3 + "
");
        out.println("value4 = " + value4 + "
");
     %>