2.12 Self-incremental operator and self-reduction operator

xiaoxiao2021-03-06  45

Incrementing is an Increment Operator, and a self-reduction operator (Decrement Operator).

The following example illustrates the role of the self-incremental operator:

// increment.java - DemonStrate IncrementingClass Increment {public static void main (string [] args) {INT i = 0; system.out.println ("i =" i); i = i 1; system.out. Println ("i =" i); i ; system.out.println ("i =" i); i ; system.out.println ("i =" i);}}

The self-increasing or self-loss operator can be placed in front or behind, put the back (like above) into the self-increasing (self-reduction) operator, placed before the front (Prefix) Operator. Before, the afterge (self-reduction) operators will increase the variable (decrease), but from the angle of the expression (not from the angle of the variable), the expression "i " is i, and the expression The value of " i" is (i 1). This is different, you can refer to the program below 32.

转载请注明原文地址:https://www.9cbs.com/read-84110.html

New Post(0)