What is the difference between += and =+?

后端 未结 9 1691
夕颜
夕颜 2020-12-03 14:07

What is the difference between += and =+? Specifically, in java, but in general also.

9条回答
  •  我在风中等你
    2020-12-03 15:04

    += is a way to increment numbers or String in java. E.g.

    int i = 17;
    i += 10;  // i becomes 27 now.
    

    There is no =+ operator. But if you do i =+ 10; it means i is equal to +10 which is equal to just 10.

提交回复
热议问题