JSP Java


  
    Incrementing and Decrementing
  
  
    

Incrementing and Decrementing


    <%
        int value1 = 0, value2 = 0;
        out.println("value1 = " + value1 + "
");
        out.println("value2 = " + value2 + "
");
        value2 = value1++;
        out.println("After value2 = value1++:" + "
");
        out.println("value1 = " + value1 + "
");
        out.println("value2 = " + value2 + "
");
        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 + "
");
     %>