+ 2

Am I did wrong?

in all my Java programs I had used "i++" to increase by one. I never understand for what it used the "++i" form.

19th Nov 2016, 1:22 PM
Fer R. Carrizo-Medina
Fer R. Carrizo-Medina - avatar
5 ответов
+ 12
if you use 'x = y++', the 'x' will have the actual value of 'y' and after that the 'y' will be increment. But if you use 'x = ++y', first 'y' will be increment, and 'x' will have the actual value of 'y' (I hope this helps . . .rs)
19th Nov 2016, 1:55 PM
Alex Qo
Alex Qo - avatar
+ 1
https://code.sololearn.com/c68JVx3xS9B0/?ref=app Check this. It is self explanatory. It might be helpful for you
15th Feb 2017, 1:37 PM
Kommoju Sunil Kumar
Kommoju Sunil Kumar - avatar
0
thank U!!!!!!!!
22nd Nov 2016, 12:47 PM
Fer R. Carrizo-Medina
Fer R. Carrizo-Medina - avatar
0
Hello guys
22nd Nov 2016, 6:32 PM
Palanding
0
nice
15th Feb 2017, 3:00 PM
Yadu Raj Sapkota
Yadu Raj Sapkota - avatar