I do understand that both += and var1=var1+var2 both do the same thing in Java. My question is, apart from better readability, what other benefit(if any) the former brings? Im asking because I was curious why java developers introduced this, they should have done it because of some value addition.
Share
x+=yandx=x+yare not same.x+=yis equivalent tox=(Type of x)(x+y)