当前位置: 动力学知识库 > 问答 > 编程问答 >

In Java: what does += do or mean?

问题描述:

Possible Duplicate:

Java += Means What?

Is a += b exactly equal to a = a+b ?

网友答案:

Yes, that is correct.

a += b is the same as a = a + b. Also, a++ is the same as a += 1 or a = a + 1.

It is worth nothing that this can be done with other operands as well, including -=, *=, and /=. However, there is only a ++ and -- (no // or **).

分享给朋友:
您可能感兴趣的文章:
随机阅读: