0
Why this example prints 17?
Good evening coders. I started to learn java and I finaly done with arrays, but i dont understand why following example returns 17. https://code.sololearn.com/cwITzSH1f4hG/?ref=app
3 Respuestas
+ 6
In the loop there an addition inside conditional operator
0+1+2+10+4 = 17
+ 5
It is compound assignment operation
a +=1 is the same as a = a + 1
You could use
+= -= *= /= %=
0
Thanks, but what does a "+=" symbol? I didn't get it at all.