I've seen code example that had
x += y
and I can't seem to find any explanation for this.
Please help. Thanks.
I've seen code example that had
x += y
and I can't seem to find any explanation for this.
Please help. Thanks.
From: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op1.html
You can also combine the arithmetic operators with the simple assignment operator to create compound assignments. For example, x+=1; and x=x+1; both increment the value of x by 1.