开发者

What is the Java "=+" operator? [duplicate]

开发者 https://www.devze.com 2023-01-12 10:28 出处:网络
This question already has answers here: 开发者_如何学Python Closed 12 years ago. Possible Duplicate:
This question already has answers here: 开发者_如何学Python Closed 12 years ago.

Possible Duplicate:

What is the difference between += and =+?

I know what saying x+=1; means

but what does

saying x=+1; mean?


There is no =+ operator. x=+1 simply means assign +1 (positive 1) to x.


It assigns a value of +1 to variable x.


x += 1 can also be written as x = x + 1

0

精彩评论

暂无评论...
验证码 换一张
取 消