increment operator

1 topic · 1 source

Technology› Programming

Java

An operator (++) that adds one to its operand. It has two forms: pre-increment (++x) and post-increment (x++). In its pre-increment form, the result of the expression is the value of its argument after the increment. In its post-increment form, the result is the value of its argument before the increment is performed. After the following,

 int a = 5, b = 5; int y,z; y = ++a; z = b++ 
y has the value 6 and z has the value 5. Both a and b have the value 6.

Cite this definition

APA
MLA
Chicago