Java Basic

Using Increment and Decrement Operators

views

08:21
Let us check the program for increment and decrement operators. These operators come in two forms. They appear in postfix and prefix form. In prefix form these operators precede the variable whereas in the postfix they are appended to the variable. So what is the difference between the two then? When the integer comes as a prefix, the operand is incremented or decremented before the value of an expression in use is obtained. In postfix format, the previous value of an expression is obtained and then the operand gets modified.