- Jun 17, 2001
- 55,420
- 1,600
- 126
I got a question about the increment operator in java
a=1
A++ means that A is now equal to 2, but when does it increment?
ex)
i = 1;
system.out.print(i++);
assuming my syntax is correct
would that print 1, then increase i to 2, or increase i to 2 then print it?
i think i++ would write it first, then increment it, and ++i would increment it, then write it
correct? yes no maybe so????
a=1
A++ means that A is now equal to 2, but when does it increment?
ex)
i = 1;
system.out.print(i++);
assuming my syntax is correct
would that print 1, then increase i to 2, or increase i to 2 then print it?
i think i++ would write it first, then increment it, and ++i would increment it, then write it
correct? yes no maybe so????
