Java += operator?

This question already has an answer here:

  • Why don't Java's +=, -=, *=, /= compound assignment operators require casting? 11 answers

  • See this post. The result of adding a char to another char is an int, which cannot be added to the String. Whereas with s = s + c1 + c2, the '+' operator associates left to right so the chars are converted to fit string concatenation.

    链接地址: http://www.djcxy.com/p/12798.html

    上一篇: 从Java中的finally块返回

    下一篇: Java + =运算符?